I made a project on react-native. All was working fine and whenever I create debug apk it also worked always. but now I have to create a signed release apk to deploy it on google play store. For that I created a keystore file with command keytool -genkey -v -keystore ENTER_APP_Name.keystore -alias ENTER_APP_Alias_Name -keyalg RSA -keysize 2048 -validity 10000. I added keystore details to build.gradle as
....
android {
....
signingConfigs {
release {
storeFile file('your_key_file_name.keystore')
storePassword 'your_key_store_password'
keyAlias 'your_key_file_alias'
keyPassword 'your_key_file_alias_password'
}
}
buildTypes {
release {
....
signingConfig signingConfigs.release
}
}
}
....
and added the keystore file to android/app/app.keystore
After something strange happened with me. Some times react-native run-android gives error, Sometimes debug APK gives and all the time release apk giving one or two error, each time it is different.
I tried to create release apk with two methods.
1. with terminal : inside the project folder :
react-native bundle --platform android --dev false --entry-file
index.android.js --bundle-output
android/app/src/main/assets/index.android.bundle --assets-dest
android/app/src/main/res
then cd android
then gradlew assembleRelease
- with android studio : build > generate signed apk > select apk then next then added keystore details then select release option and then finish.
These both methods gave me different errors but randomly not all together. I have mentioned them following : 1. Task :app:processReleaseResources FAILED( Android resource linking failed) 2. Task :app:processDebugResources FAILED( Android resource linking failed) 3. Android resource linking failed 4.app\android\app\build\intermediates\merged_manifests\release\AndroidManifest.xml:17: error: resource mipmap/ic_launcher (aka com.app:mipmap/ic_launcher) not found. 5. app\android\app\build\intermediates\merged_manifests\release\AndroidManifest.xml:17: error: resource mipmap/ic_launcher_round (aka com.app:mipmap/ic_launcher_round) not found. 6. error: failed processing manifest.