简体   繁体   English

Xcode iOS 发布版本不断归档旧版本的 React 本机应用程序

[英]Xcode iOS Release build keeps archiving old version of React native app

I am running react native project on Xcode.我正在 Xcode 上运行 react native 项目。 It builds successfully on debug with latest code.它使用最新代码在调试时成功构建。 However when I run on Release mode or archive it for submitting to appstore, it builds old version.但是,当我在发布模式下运行或将其存档以提交到应用商店时,它会构建旧版本。

Xcode: 12, RN: 0.63.2 Xcode:12,RN:0.63.2

I tried all the options possible given in similar posts.我尝试了类似帖子中给出的所有可能选项。 None of them worked!他们都没有工作!

1.reset npm/RN cache 1.重置npm/RN缓存
watchman watch-del-all.守望者手表-德尔-所有。
npm cache clean --force. npm 缓存清理——强制。

2.delete npm modules, 2.删除npm模块,
rm -rf node_modules rm -rf 节点模块

3.delete ios/build, main.jsbundle, ios/assets. 3.删除ios/build、main.jsbundle、ios/assets。
xcodebuild clean xcodebuild 干净

4.Clean Xcode, ~/Library/Developer/Xcode/ 4.清理Xcode,~/Library/Developer/Xcode/

5.Reinstall npm, pods 5.重新安装npm,吊舱

6.Run react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios 6.运行 react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios

7.npm start -- --reset-cache 7.npm 启动 -- --reset-cache

and so on.等等。

Still no success.仍然没有成功。 Stuck in this issue for past 3 days.在过去的 3 天里一直停留在这个问题上。

Finally the culprit was codepush.最后罪魁祸首是codepush。 We're using appcenter codepush which pushes live javascript update to the mobile devices.我们正在使用 appcenter codepush 将实时 javascript 更新推送到移动设备。 Our latest code was not updated in appcenter server for ios, therefore it keeps pushing old code.我们的最新代码在 ios 的 appcenter 服务器中没有更新,因此它一直在推送旧代码。 Once we updated it, it starts pushing the correct update.一旦我们更新它,它就会开始推送正确的更新。

Also make sure that latest main.jsbundle is bundled with the ios code by running "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios".还要确保最新的 main.jsbundle 与 ios 代码捆绑在一起,方法是运行“react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets -dest ios”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM