android studio 编译:Could not find common.jar (android.arch.core:common:1.0.0)

祖翰音
2023-12-01

在编译android studio时候会出现这样的bug:

Error:Could not resolve all files for configuration ':androidsort:debugCompileClasspath'.
> Could not find common.jar (android.arch.core:common:1.0.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

这是没有连接到google的缘故;
需要在项目的build.gradle中加入(注意是project–> build.gradle):

buildscript {
    ......
}

allprojects {
    repositories {
        google()
        jcenter()
        maven{url 'https://jitpack.io'}

    }
}

加完之后,rebuild一下就OK了

 类似资料: