安装过程无法编译, 按以下方法修正
A mix of things worked for me.
react: 16.3.1 => 16.3.1
react-native: 0.55.1 => 0.55.1
Add the following to your dependecies inside android/app/build.gradle
compileSdkVersion 26
buildToolsVersion '26.0.2'
targetSdkVersion 26
compile ("com.android.support:support-v4:26.0.1") {
force = true //<-- force dependency resolution to 26.0.1 in my case
}
Also make sure to update android/build.gradle to use gradle 3 and add google
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
Don't forget to also to update the distribuitionUrl in android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
react-native-camera 填坑
最新推荐文章于 2024-06-24 09:44:03 发布