I am running react native project on Xcode. 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
I tried all the options possible given in similar posts. None of them worked!
1.reset npm/RN cache
watchman watch-del-all.
npm cache clean --force.
2.delete npm modules,
rm -rf node_modules
3.delete ios/build, main.jsbundle, ios/assets.
xcodebuild clean
4.Clean Xcode, ~/Library/Developer/Xcode/
5.Reinstall npm, pods
6.Run react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
7.npm start -- --reset-cache
and so on.
Still no success. Stuck in this issue for past 3 days.
1 Answer 1
Finally the culprit was codepush. We're using appcenter codepush which pushes live javascript update to the mobile devices. Our latest code was not updated in appcenter server for ios, therefore it keeps pushing old code. 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".