I don't know really why my compiled apk is trying to reach metor server
I am creating a iOS / android app using react-native
The build was working before
cd android/
./gradlew assembleRelease --stacktrace
Generated in android/app/build/outputs/apk/release
Error showing your metro bundle is not found. You need to create bundle using following command
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Other way to create release build
Place the my-release-key.keystore
file under the android/app directory in your project folder
Edit the file ~/.gradle/gradle.properties and add the following (replace ***** with the correct keystore password, alias and key password
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore MYAPP_RELEASE_KEY_ALIAS=my-key-alias MYAPP_RELEASE_STORE_PASSWORD=***** MYAPP_RELEASE_KEY_PASSWORD=*****
Edit the file android/app/build.gradle in your project folder and add the signing config
android { defaultConfig { ... } signingConfigs { release { storeFile file(MYAPP_RELEASE_STORE_FILE) storePassword MYAPP_RELEASE_STORE_PASSWORD keyAlias MYAPP_RELEASE_KEY_ALIAS keyPassword MYAPP_RELEASE_KEY_PASSWORD } } buildTypes { release { ... signingConfig signingConfigs.release } } } ...
Run this command on terminal
react-native run-android --variant=release
https://facebook.github.io/react-native/docs/signed-apk-android