[英]React-Native Android - Could not find com.android.tools:common
It seems that somehow the android/tools/common
library has been deleted ( pom , jar ). 似乎不知何故android/tools/common
库已被删除( pom , jar )。
This caused many react native libraries that are using an old gradle version in their classpath (eg com.android.tools.build:gradle:2.2.3
) to not being able to sync 这导致许多反应原生库在其类路径中使用旧的gradle版本(例如com.android.tools.build:gradle:2.2.3
)无法同步
How can i fix it? 我该如何解决?
Update , I had to add more code to build.gradle 更新 ,我不得不为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 这是我的修复,我没有使用这个解决方法的fork repos:将它添加到你的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/" }
}
}
}
}
In my build.gradle file (of the project not the app) i've added the new bintray url first but also had to add all the others after: 在我的build.gradle文件(项目不是应用程序)中,我首先添加了新的bintray网址,但也必须在之后添加所有其他网址:
subprojects {
buildscript {
repositories {
maven { url 'https://dl.bintray.com/android/android-tools' }
google()
mavenLocal()
jcenter()
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.