(直接从必应翻译过来,我的问题样已经解决,有几种方案)
将支持库版本升级到27.1.1后我同步项目我遇到以下错误:
Failed to resolve: support-core-utils
任何的想法?
这是我的项目级构建文件:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
和应用程序级别构建文件:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
答案
我通过将google()设置为顶级build.gradle中allprojects / repositories中的第一个条目来解决这个问题
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io"
}
}
}
我有同样的问题,我改为成功。添加maven { url 'https://maven.google.com' }
作为顶级所有项目/存储库中的第一个条目build.gradle
-
虽然它已经存在于OP。
google()
是谷歌回购 - 佐伊 5月29日7:30 -
这个问题有什么进展吗?我有同样的问题 - Mysterious_android 6月6日4:18
-
1
改变顺序确实对我有用。任何解释? - Jantzilla 6月7日21:27
-
这对我也有用,谢谢你的回答。对这个无意义的bug感到羞耻。 - SerdarSamancıoğlu 10月31日10:53
-
也为我工作...... - Rehan Raza 11月2日19:48
在我的例子中,这是因为库依赖,我通过从该库中排除support-core-utils来解决:
implementation ('com.github.chrisbanes:PhotoView:2.0.0'){
exclude module: 'support-core-utils'
}
我对AppCompat
版本库有同样的问题28.0.0
。我用它来修复它28.0.0-alpha1
。答案都没有帮助我。
Android studio 3.1.4
定位并编译sdk 28。