I made some styling changes to my react native app. Everything looks good in debug so I tried to run the release variant using 'react-native run-android --variant=release' and none of that changes in debug show up. I made sure I wasn't crazy and removed the background image. The release variant didn't change at all. I then tried generating the signed apk and installing it manually. Same thing.
I can't seem to find anything on google. Has anyone had this problem before or have suggestions on what to try? I've combed through all the config files and everything seems right. I know its hard without being able to look at the code but I can't share it since its for internal company use only.
For anyone still struggling with this, updating index.android.bundle usually solves this issue:
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/
1 - Perform adb reverse..check below got to platform-tools in cmd
C:\Users\username\AppData\Local\Android\Sdk\platform-tools --> adb reverse tcp:8081 tcp:8081
2 - Then delete any bundle file if present in assets folder
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
3 - run --> react-native run-android --variant=release
or react-native run-android
Related
I'm trying to implement the video conference functionality by using the react-native-jitsi-meet library. But app is being crashed without showing any issue.
I have used added the package and implemented the android process for the react version > 0.60 as mentioned in the document(https://github.com/skrafft/react-native-jitsi-meet) unable to find the issue. Haven't added any code in the JS file too.
I have tried react-native-jitsi-meet module not found also but still the issue continues.
As it is specified in documentation we already changed the app.bundle as rename and it is bundling incorrectly so do this changes.
Remove the following file
android/app/src/main/assets/index.android.bundle
npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/app.bundle --assets-dest android/app/src/main/res/ && cd android && ./gradlew assembleDebug
I built a new APK after I added react-redux and persist. The debug build is working perfect but the release one seems it didn't get the new code cause its working like before.
I'm not sure, why it's happening?. I tried ./gradlew clean too but it didn't help.
Delete the build folder from the android/app directory. Delete Node Modules and do a fresh install. If this does not work then run metro bundler using the below command.
react-native start --reset-cache
The solution was to run 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/ and then building the apk again
I am using redux persist and I have previously persisted a list of data, but even after building the app in release, the app is shipped with some previous data that's not cleared out. A fresh build is not there , I have tried the following
react-native run-android --variant=release
cd android && ./gradlew assembleRelease
I have also run this code to bundle, but no use
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/
This is causing an error for me on initial app start up cuz of the old data, and the only way I am able to clear data is clearing app data from device settings
Ok, it seems the issue was from backup process being enabled , this helped https://stackoverflow.com/a/55294158/7266219
I have made many changes in my js code, when I run in debug mode I'm able to see all the changes but when I run the app in release mode or generate a release apk, the changes that were made and visible in debug mode are not visible.
What I have already tried?
react-native run-android --variant=release
Deleted the builds folder and android.bundle.js in assets
Run the below command before you run release variant in the project directory.
So command sequence will be first execute
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/
This may take little time to finsh.
Then execute your run command:
react-native run-android --variant=release
I am pretty new to react-native development, I have a project which run properly with iOS simulator, while on android (Emulator and device) it gives Unexpected token '>' error
Try to change "android" folder name to "android-backup"
And run following in the terminal:
$cd MyProjectFolder
$npm start
$react-native start
this work refresh your android project.
also you can clean gradlew with:
$cd android
$gradlew clean
try this
Open Terminal
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