React-Native Android-找不到com.android.tools:common [英] React-Native Android - Could not find com.android.tools:common
问题描述
似乎android/tools/common
库已被删除
( pom ,<一个href ="https://jcenter.bintray.com/com/android/tools/common/25.2.3/common-25.2.3.jar" rel ="nofollow noreferrer"> jar ).>
这导致许多反应本机库在类路径中使用旧的gradle版本(例如com.android.tools.build:gradle:2.2.3
)无法同步
我该如何解决?
更新,我不得不向 build.gradle
添加更多代码这是我的解决方法,我没有使用这个变通办法来生成存储库:将其添加到您的 build.gradle 文件中,并将其添加到 settings.gradle 文件的同级文件中>
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/" }
}
}
}
}
It seems that somehow the android/tools/common
library has been deleted
(pom, jar).
This caused many react native libraries that are using an old gradle version in their classpath (e.g com.android.tools.build:gradle:2.2.3
) to not being able to sync
How can i fix it?
Update, I had to add more code to build.gradle
This is my fix, I did not fork repos just used this workaround: add this to your build.gradle file, the sibling of settings.gradle file
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/" }
}
}
}
}
这篇关于React-Native Android-找不到com.android.tools:common的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!