Gradle在播放服务方面非常慢:8.4.0

时间:2016-02-07 16:48:57

标签: java android gradle google-play-services

我有问题,我在我的项目中使用play-services:8.4.0,当编译我的项目时,它非常慢!!

编译项目需要5到9分钟。

为什么?

2 个答案:

答案 0 :(得分:1)

你应该避免编译整个游戏服务。您只能使用必要的。例如,如果您只想为广告使用播放服务,

而不是输入:

compile 'com.google.android.gms:play-services:8.4.0'

只需输入:

compile 'com.google.android.gms:play-services-ads:8.4.0'

如果您不知道自己需要哪一个,可以查看Selectively compiling APIs into your executable

我希望它有所帮助!

答案 1 :(得分:-1)

部分地,您的开发机器需要更多RAM,更快的CPU或SSD。

部分地,play-services非常大依赖关系。您可能希望切换到更集中的依赖项,只加载您的应用程序真正需要的特定Play服务。 the Play Services setup documentation中的“有选择地将API编译到您的可执行文件”部分中对此进行了介绍。

相关问题