构建工具的更新打破我的编译 [英] Build tools update breaks my compile

查看:214
本文介绍了构建工具的更新打破我的编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天早上更新的Andr​​oid 2.0工作室preVIEW 4至5。如果我继续构建:

  {相关性
    类路径'com.android.tools.build:gradle:2.0.0-alpha3
}

这仍然成功编译。但是,如果我上移至-alpha5我得到这个错误:


  

错误:执行失败的任务:应用程序:compileReleaseJavaWithJavac。
   java.io.FileNotFoundException:C:.... \\ \\中间体爆炸-AAR \\ com.google.android.gms \\播放服务\\ 8.4.0 \\罐\\ classes.jar(系统找不到指定的路径)



解决方案

从现在开始,我认为谷歌希望我们不要使用这样的:

 'com.google.android.gms:发挥服务:8.4.0

但是,而添加你特别需要的服务。在这里找到它们的列表

 编译com.google.android.gms:发挥服务 - 分析:8.4.0
编译com.google.android.gms:播放服务,appinvite:8.4.0
编译com.google.android.gms:播放服务,地图:8.4.0
编译com.google.android.gms:播放服务地点:8.4.0
编译com.google.android.gms:发挥服务加:8.4.0
编译com.google.android.gms:播放服务驱动:8.4.0

此外,还需要在应用play业务插件的最后一行应用程序的gradle这个的:

 应用插件:'com.google.gms.google的服务。

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)

解决方案

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'

这篇关于构建工具的更新打破我的编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆