Reputation: 394
This occurs in both production and dev builds. I can connect to the dev server, reload, and the new code is built and runs on the device.
Step-by-step of what I have tried:
Modify code.
Re-bundle:
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
./gradlew clean
react-native run-android
- Builds old version
react-native run-android --variant=release
- Builds old version
Is there any way to completely wipe the android
build and build from scratch? My gut tells me that run-android
is not performing a full clean build.
Upvotes: 21
Views: 13734
Reputation: 159
Maybe that's not exactly what you have faced. But I was creating a staging
buildType in my react native project too, the build was fine (after dealing with some problems), but for some reason it was loading an old version of the app too.
After changing the buildType from staging
to releaseStaging
, it started to build as expected.
I hope this answer helps anyone that might land in this page just like I did.
I've answered in another topic too with more specific instructions.
Upvotes: 0
Reputation: 462
$ 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
$ react-native run-android
Upvotes: 44