(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
Similar Posts:
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
- Could not find com.android.tools.build:gradle:3.3.0.
- Plugin is too old, please update to a more recent
- [Solved] Could not find com.android.tools.build:aapt2:3.2.1-4818971.
- [Solved] Ionic3 Package Error: Could not resolve all files for configuration ‘:classpath’.
- AS Import Project Error: Plugin with id ‘com.android.application’ not found.
- [Solved] Could not find com.android.tools.build:gradle:3.0.1
- Error:(1, 0) Plugin with id ‘android’ not found.
- Build failed for Android studio new project
- [Solved] Android Warning: Gradle DSL method not found: ‘android()’