今天很多RN的安卓项目同时跑不起来了,是因为https://jcenter.bintray.com/ 网站挂了,产生的问题.
具体会报错: Could not resolve com.android.tool.build:gradle:2.3.+
目前解决方法是替换为阿里云的镜像.
将报错用到的安卓组件在build.gradle文件里面的jcenter() 都替换掉
具体是这样:
repositories {
google()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// jcenter()
}
allprojects {
repositories {
mavenLocal()
google()
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
//jcenter()
}
}