问题出现
在不同电脑Android Studio上运行同一个项目,出现
Could not find support-fragment.jar (com.android.support:support-fragment:27.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-fragment/27.1.1/support-fragment-27.1.1.jar
Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager
Failed to resolve: support-fragment
Open File
解决这个问题只需要在build.gradle文件里修改allprojects 里面的repositories,把google放到jcenter前面就可以了
原文件
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://dl.google.com/dl/android/maven2/"}
}
}
修改后
allprojects {
repositories {
maven { url 'https://maven.google.com' }
jcenter()
mavenCentral()
maven { url "https://dl.google.com/dl/android/maven2/"}
}
}