Advertisement
thanhnb

Build react-native android

Jul 24th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. https://gist.github.com/marty-wang/5a71e9d0a6a2c6d6263c
  2.  
  3. tạo thư mục assets trong android/app/src/main/..
  4. run lệnh 1
  5. curl "http://localhost:8081/index.bundle?platform=android" -o "android/app/src/main/assets/index.bundle"
  6.  
  7. run lệnh 2 để copy resource sang android
  8. react-native bundle --platform android --entry-file index.js --bundle-output android/app/src/main/assets/index.bundle --dev false --reset-cache --assets-dest android/app/src/main/res/
  9.  
  10. Run this command to clean project:
  11.  
  12. cd android && .\gradlew clean
  13. After, run the following command to run project again:
  14.  
  15. cd .. && react-native run-android
  16.  
  17. $ cd android && ./gradlew assembleRelease
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement