5

My React Native App do not respond to my changes of code in the Release mode of iOS. I don't know why but I cannot upload a new version with my changes. However, the version changes, is the only thing it changes when I apply a change in my code.

What can I do to fix it?

No matter if I build the app from XCode or by using the snippet react-native run-ios --configuration Release --device "iPhone of Charles" or if I just archive it and upload to the App Store.

4
  • do you have a main.jsbundle? If so, it will try to load from that before using the bundler to get the latest JS code. If not, try a clean (shift + cmd+ K). Commented Nov 21, 2019 at 17:03
  • 1
    It exists and last modification was yesterday. I have been cleaning with no results. In Release mode is like it's grabbing another bundle or something because it loads old code. In debug mode all works as it should work. Commented Nov 22, 2019 at 8:20
  • Try deleting the main.jsbundle Commented Nov 22, 2019 at 17:31
  • 1
    @MattyK14 I did and didn't work. Commented Nov 25, 2019 at 8:16

1 Answer 1

5

Finally I found the solution.

The problem was that the main.jsbundle I was generating was placing in the wrong place having 2 main.jsbundle at the same time, the old and corrupted and the right one.

I had the right one outside /ios/ProjectName and the old one there. I just had to apply this snippet which would generate a new and clean main.jsbundle:

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

and then get the file main.jsbundle and the assets folder and place them inside /ios/ProjectName

Thanks all for the help.

Sign up to request clarification or add additional context in comments.

4 Comments

Do you have to apply this every time you reupload to testflight?
Not fot me at least
In my case, the bundle has to be built every time before creating a release. I made a more detailed post about it here
dont move, change the output from ios/main.jsbundle to ios/ProjectName/main.jsbundle

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.