问题
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.
回答1:
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/
回答2:
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
来源:https://stackoverflow.com/questions/39680464/react-native-building-release-isnt-reflecting-changes-that-debug-does-android