(1)app/build.gradle
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
}
compile (project(‘:react-native-camera‘)) {
exclude group: "com.android.support", module: ‘support-v4‘
}
(2)build.grande
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.1‘
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
google()
maven {
url "$rootDir/../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
google()
}
}
(3)gradle/wrapper/gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
After the above three steps, my problem has been solved
If there is an image detection error during packaging, AAPT
Turn off AAPT detection in gradle/wrapper/gradle wrapper.properties
android.useDeprecatedNdk=true
+ android.enableAapt2=false
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=yangzonglong
MYAPP_RELEASE_KEY_PASSWORD=yangzonglong