What went wrong:
A problem occurred configuring project ':app'.
A problem occurred configuring project ':react-native-splash-screen'.
Could not resolve all dependencies for configuration ':react-native-splash-screen:_debugCompile'.
Could not find com.android.support:appcompat-v7:26.1.0.
Searched in the following locations:
file:/C:/Users/cj-wj/.m2/repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/.m2/repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Document/Code/CJKJ/cjhms_rn/node_modules/react-native/android/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Document/Code/CJKJ/cjhms_rn/node_modules/react-native/android/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
Required by:
cjhms_rn:react-native-splash-screen:unspecified
Could not find com.android.support:appcompat-v7:26.1.0.
Searched in the following locations:
file:/C:/Users/cj-wj/.m2/repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/.m2/repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Document/Code/CJKJ/cjhms_rn/node_modules/react-native/android/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Document/Code/CJKJ/cjhms_rn/node_modules/react-native/android/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/C:/Users/cj-wj/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
Required by:
cjhms_rn:react-native-splash-screen:unspecified > com.facebook.react:react-native:0.55.4
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
简单方法降到3.0.9需要注意,在dependencies{
"react-native-splash-screen": "3.0.9", //不能有^,否则会自动升级
}
另外3.1.0版本,需要修改node_modules\react-native-splash-screen\android\build.gradle
为
compileSdkVersion 23
buildToolsVersion "23.0.1"
targetSdkVersion 22
compile 'com.android.support:appcompat-v7:23.0.1'
In android/app/build.gradle
compileSdkVersion 26
buildToolsVersion "26.0.1"
compile "com.android.support:appcompat-v7:26.0.1"
In android/build.gradle
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
@caobing thanks,it's work
Most helpful comment
简单方法降到3.0.9需要注意,在dependencies{
"react-native-splash-screen": "3.0.9", //不能有^,否则会自动升级
}
另外3.1.0版本,需要修改node_modules\react-native-splash-screen\android\build.gradle
为
compileSdkVersion 23
buildToolsVersion "23.0.1"
targetSdkVersion 22
compile 'com.android.support:appcompat-v7:23.0.1'