Reputation: 111
in Generating the release APK I get this error :
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-smart-splashscreen:verifyReleaseResources'.
I using react-native-splashscreen react-native-cli: 2.0.1 react-native: 0.59.4
this below is my code
android { compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.inclo"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
}
Upvotes: 1
Views: 1430
Reputation: 305
Add the following lines of code in your android/build.gradle file
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
Upvotes: 3
Reputation: 883
Navigate to
node_modules/react-native-splashscreen/android/build.gradle
Edit and keep the compileSdkVersion
buildToolsVersion
minSdkVersion
targetSdkVersion
same as you have in
android/app/build.gradle
Sync the project again.
Run./gradlew assembleRelease
from the terminal or try to regnerate release APK.
Hope it works!
Upvotes: 2