Build tools update breaks my compile

白昼怎懂夜的黑 提交于 2019-11-29 22:22:58

问题


I updated Android Studio 2.0 Preview from 4 to 5 this morning. If I continue to build with:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
}

this will still compile successfully. But if I move up to -alpha5 I get this error:

Error:Execution failed for task ':app:compileReleaseJavaWithJavac'. java.io.FileNotFoundException: C:....\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar (The system cannot find the path specified)


回答1:


From now on, I think Google expects us to not use this:

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

But rather add the services you need specifically. Find a list of them here

compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-drive:8.4.0'

Also, you need to apply play service plugin in last line of your application's gradle:

apply plugin: 'com.google.gms.google-services'



回答2:


I posted a bug here. They came out with a fix very quickly. Now just use alpha6:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}


来源:https://stackoverflow.com/questions/34800861/build-tools-update-breaks-my-compile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!