美文网首页
升级到AS3.0遇到的问题汇总

升级到AS3.0遇到的问题汇总

作者: channelRead0 | 来源:发表于2018-04-08 17:21 被阅读0次

1、

Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Open File
。。。

File->Settings->Build, Execution, Deployment->Gradle->取消Offline work选项的勾选,重构项目。
喜欢离线环境的可以重构完项目,重新打开。

2、

Error:Execution failed for task ':app:preDebugAndroidTestBuild'.

Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

原因:测试用的库的版本和app的不一致,导致依赖包冲突。

解决方法:
1、为测试指定版本

androidTestCompile('com.android.support:support-annotations:26.1.0') {
        force = true
    }

2、统一模块依赖版本

configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:26.1.0' }

相关文章

网友评论

      本文标题:升级到AS3.0遇到的问题汇总

      本文链接:https://www.haomeiwen.com/subject/cfdmhftx.html