Skip to content

Instantly share code, notes, and snippets.

@erikyuntantyo
Last active October 29, 2023 06:36
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save erikyuntantyo/d5ca92b19cb06aedb61c89324f6abc27 to your computer and use it in GitHub Desktop.
Save erikyuntantyo/d5ca92b19cb06aedb61c89324f6abc27 to your computer and use it in GitHub Desktop.
Build react-native offline bundling into android
# create assets folder in the current project
$ mkdir android/app/src/main/assets
# create bundle script
$ 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/
# execute command to run android to create debug apk
$ react-native run-android
# Or change to android folder
$ cd android
# build debug apk
$ ./gradlew assembleDebug
# build release/unsigned apk
$ ./gradlew assembleRelease
@Moacyr007
Copy link

Moacyr007 commented Mar 13, 2020

doesn't work T_T

@erikyuntantyo
Copy link
Author

@Moacyr007 could you tell me which part that doesn't work?

@alonronin
Copy link

works perfectly

@zandercodes
Copy link

zandercodes commented Mar 30, 2020

Why index.android.bundle?
I use main.jsbundle

@erikyuntantyo
Copy link
Author

@alonronin thank you

@zandercodes sorry, is there any issue?

@Zeeshan-appifytech
Copy link

Working fine!

@achyuthjoism
Copy link

Thanks Bro

@bassemsab
Copy link

Thanks a million !

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