【发布时间】:2019-05-10 12:20:39
【问题描述】:
似乎不知何故 android/tools/common 库已被删除
(pom,jar)。
这导致许多在其类路径中使用旧 gradle 版本(例如 com.android.tools.build:gradle:2.2.3)的原生库无法同步
我该如何解决?
【问题讨论】:
标签: android android-studio react-native android-gradle-plugin jcenter
似乎不知何故 android/tools/common 库已被删除
(pom,jar)。
这导致许多在其类路径中使用旧 gradle 版本(例如 com.android.tools.build:gradle:2.2.3)的原生库无法同步
我该如何解决?
【问题讨论】:
标签: android android-studio react-native android-gradle-plugin jcenter
更新,我不得不向 build.gradle
添加更多代码这是我的修复,我没有 fork 存储库,只是使用了这个解决方法:将它添加到您的 build.gradle 文件中,settings.gradle 文件的同级文件 p>
buildscript {
repositories {
google()
jcenter { url "http://jcenter.bintray.com/"}
maven { url "https://dl.bintray.com/android/android-tools" }
}
}
subprojects { project ->
def name = project.name
if (name.contains('module name, e.g. react-native-blur')
|| name.contains('other module name, e.g. react-native-image-picker')) {
buildscript {
repositories {
maven { url "https://dl.bintray.com/android/android-tools/" }
}
}
}
}
【讨论】:
在我的 build.gradle 文件(项目而不是应用程序)中,我首先添加了新的 bintray url,但之后还必须添加所有其他的:
subprojects {
buildscript {
repositories {
maven { url 'https://dl.bintray.com/android/android-tools' }
google()
mavenLocal()
jcenter()
}
}
}
【讨论】: