找不到common.jar(android.arch.core:common:1.1.0)
我创建了一个新项目,但当它完成第一次编译时,新项目返回一个错误:找不到common.jar(android.arch.core:common:1.1.0),android,android-studio,gradle,Android,Android Studio,Gradle,我创建了一个新项目,但当它完成第一次编译时,新项目返回一个错误: Error:Could not find common.jar (android.arch.core:common:1.1.0). Searched in the following locations: https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar 我真的不知道怎么解决,希望你能帮我 我如何创建新项目的屏幕截图:
Error:Could not find common.jar (android.arch.core:common:1.1.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar
我真的不知道怎么解决,希望你能帮我
我如何创建新项目的屏幕截图:
Build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
include ':app'
设置。渐变
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
include ':app'
我添加了gradle文件,因为我认为这是一个问题。Add
maven{url'https://maven.google.com“}
在中的jcenter()之前
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
}
}
它会起作用的
更新:
注意:google()
和maven{url'https://maven.google.com“}
指向同一回购,google()
是谷歌的Maven回购快捷方式。您可以添加google()
而不是maven{url'https://maven.google.com“}
如果您正在使用:
渐变>=v.4.x+
Android Studio>=3.x+
Android的Gradle插件>=3.x+
在这两个部分中,您都需要
如果您升级了Android Studio,这将为您完成在存储库容器上找不到参数[]的方法google()。我为他们工作的公司都使用Android 2.2,所以我也需要使用它,很遗憾我知道:/n您需要单击链接查看备用URL或升级使用Gradle 4.1(并将Android Studio配置为使用它),链接中也提到了顺序有时很重要,我的构建在CircleCI中失败,因为jcenter()
位于前一行,而不是google()
,所以它在jcenter中搜索架构组件,然后failing@voghDev谢谢你!我被我的CI抱怨的原因弄糊涂了,这帮我解决了。非常感谢它工作得非常好!似乎订单很重要。有人能解释为什么订单很重要吗?@hiddeneyes02似乎是个bug:而不是看下一个如果gradle在当前的回购协议中找不到它想要的东西,它将直接产生一个错误,因此将谷歌的回购协议推到顶端是目前的工作解决方案