Androidstudio在开发中总能遇到许多奇奇怪怪的问题,我将这鞋问题集合起来,希望可以帮到大家
1.Resolved versions for app (26.1.0) and test app (27.1.1)differ. 错误
在app中的gradale中添加
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:26.1.0'
}
2.Android dependency has different version.You should manually set the same versio
这个问题在多模块开发中经常遇到,笔者也经常遇到,解决办法:
在你的项目中:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
//统一版本号
details.useVersion "26.1.0"
}
}
3.Could not find com.android.tools.build:gradle:3.0.0.
在你项目:
allprojects{
repositories{
jcenter()
google()
}
}
添加 google()
4.打包错误:To proceed, either fix the issues identified by lint, or modify your build script as follows:
在你app和modlue的build.gradle中添加如下代码:
android {
...
lintOptions {
checkReleaseBuildsfalse
abortOnErrorfalse
}
}
网友评论