React 本机构建版本未反映调试所做的更改 (android)

React native building release isn't reflecting changes that debug does (android)

我对我的 React 本机应用程序进行了一些样式更改。在调试中一切看起来都很好,所以我尝试使用 'react-native run-android --variant=release' 和 none 显示调试中显示的更改 运行 发布变体。我确保我没有发疯并删除了背景图片。发布变体根本没有改变。然后我尝试生成签名的 apk 并手动安装它。一样的。

我似乎在 google 上找不到任何内容。以前有没有人遇到过这个问题或对尝试什么有建议?我梳理了所有配置文件,一切似乎都正确。我知道不能看代码很难,但我不能分享它,因为它仅供公司内部使用。

对于仍在为此苦苦挣扎的任何人,更新 index.android.bundle 通常可以解决此问题:

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 - 执行 adb reverse..检查下面在 cmd 中的平台工具 C:\Users\username\AppData\Local\Android\Sdk\platform-tools --> adb reverse tcp:8081 tcp:8081

2 - 然后删除资产文件夹中存在的任何捆绑文件 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 - 运行 --> react-native 运行-android --variant=release 或本机反应 运行-android