Skip to content

Instantly share code, notes, and snippets.

@erickhaendel
Last active August 29, 2023 15:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erickhaendel/0ec3eb90eddac3e9ae6eb9ca40559050 to your computer and use it in GitHub Desktop.
Save erickhaendel/0ec3eb90eddac3e9ae6eb9ca40559050 to your computer and use it in GitHub Desktop.
Generate APK debug in React Native

Please follow those steps.

Bundle your js:

  • if you have index.android.js in project root then run
  react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
  • if you have index.js in project root then run
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

Create debug apk:

cd android/
.\gradlew assembleDebug
Then You can find your apk here:
cd app/build/outputs/apk/

Ref: Stackoverflow

@AlejandroBelloIglesias
Copy link

I got

error ENOENT: no such file or directory, open 'android/app/src/main/assets/index.android.bundle'

Had to do mkdir before

mkdir android/app/src/main/assets/

Thank you for this solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment