For some reason android is keep installing the oldest apk in mobile devices, The Js code is not updated. I tried following methods:
- I tried using
npm run android
- I tried installing apk through android studio.
- I made the release and debug apk through android studio and install it manually on devices.
None of the above method works.
Somewhere I found that first I need to Bundle script using following
npx 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/
In order to compile assets everytime for an offline apk. I believe this is not a good method ,I don't want to bundle every time after changes.
I want whole apk generation process to be automated. So Kindly guide me for tools and process for automating this whole process.
Most probably the issue occured due to cache,Uninstall the app from device and delete the build folder inside.
Create an Assets Folder
Run bundle script
Execute command to run android to create debug apk
For Automated deployment, you might take a look Fastlane.you may require other tools also.
https://docs.fastlane.tools/getting-started/cross-platform/react-native/
Also read this article , it might help you also getting started with FastLane https://carloscuesta.me/blog/shipping-react-native-apps-with-fastlane