1

React Native, How to clean up my project ? as after apk generation I am getting the old version of APK file.

New changes are not applied to the new generated APK all the time I am getting the same apk file.

FYI I am using Android studio. I have tried to clean up the project but results are not changed.

Emil Hakobyan
  • 153
  • 1
  • 8
  • Are you building the APK through Android Studio? If so, just run `cd android && gradlew assembleRelease` on your terminal and you're good to go – Ray Oct 05 '17 at 13:36
  • That command will bundle your JS code before building the APK file. (Please note that that way, you're going to have to manually sign your app) – Ray Oct 05 '17 at 13:37

1 Answers1

2

You should go to your project folder then run the react-native bundle command then generate the apk.

Steps to generate bundle

cd /folder/yourproject/

Then run

sudo react-native bundle --platform android --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --dev false --reset-cache --assets-dest android/app/src/main/res/

Create assets folder inside android/app/main/src/ folder if command fails with error: folder doesn't exists.

After this command runs successfully now you can generate the updated apk file

Victor
  • 4,171
  • 1
  • 29
  • 37