2

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.

asked Feb 10, 2021 at 6:48

1 Answer 1

6

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".

answered Feb 23, 2021 at 11:29
Sign up to request clarification or add additional context in comments.

1 Comment

Wow. Any idea how often the main.jsbundle file should be regenerated? every time an archive is created?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.