0

When I run react-native run-android the correct version of my app runs on both the emulator and a physical device. However, the moment I try to run ./gradlew assembleRelease or react-native run-android --variant=release I get an older version of the app. I've tried running ./gradlew clean before running assembleRelease. I've also tried manually deleting the apk and json files. But I keep getting an old version of the app which doesn't have all the new features.

EDIT: Using the directions from this post. I was able to get the new version to load, however, I lost all of the new images that came with the newer version. Any ideas how to make sure the images are loaded

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest andro id/app/src/main/res
VK1
  • 1,676
  • 4
  • 28
  • 51

1 Answers1

1

Originally from this SO post

https://github.com/react-community/lottie-react-native/issues/269

Go to your project directory and check if this folder exists android/app/src/main/assets i) If it exists then delete two files viz index.android.bundle and index.android.bundle.meta ii) If the folder assets doesn't exist then create the assets directory there.

From your root project directory do cd android && ./gradlew clean

Finally, navigate back to the root directory and check if there is one single entry file called index.js i) If there is only one file i.e. index.js then run following command 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

ii) If there are two files i.e index.android.js and index.ios.js then run this react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

VK1
  • 1,676
  • 4
  • 28
  • 51