一 翻墙
二 改 / android / build.gradle里面的配置,换个maven地址,改成阿里镜像地址
maven {
url 'http://maven.aliyun.com/nexus/content/groups/public'
//如果上面的阿里云镜像不行,就尝试用下面的的试试。如果用下面的,上面的就注释掉。
//maven { url 'https://maven.aliyun.com/repository/public' }
}
注意 build.gradle 文件下的2个 repositories 都要添加。
buildscript {
repositories {
jcenter()
maven {
// url 'https://maven.google.com/'
// name 'Google'
url 'http://maven.aliyun.com/nexus/content/groups/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// url 'https://maven.google.com/'
// name 'Google'
url 'http://maven.aliyun.com/nexus/content/groups/public'
}
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/maven"
}
}
}
dependencies {
}
最后再重新sync一下