使用React Native iOS Release Build不会加载新代码,但是版本会加载 [英] Using React Native iOS Release Build doesn't load new code but the version does

查看:54
本文介绍了使用React Native iOS Release Build不会加载新代码,但是版本会加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS的发布模式下,我的React Native应用程序不响应我的代码更改.我不知道为什么,但无法上传更改的新版本.但是,版本更改是我在代码中应用更改时唯一更改的内容.

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.

该如何解决?

无论是从XCode生成应用程序,还是使用代码段 react-native run-ios --configuration Release --device"Charles iPhone" ,或者我只是将其存档并上传到App Store.

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.

推荐答案

最后我找到了解决方案.

Finally I found the solution.

问题是我生成的main.jsbundle放置在错误的位置,该位置同时具有2个main.jsbundle(旧的和损坏的,正确的).

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.

我在/ios/ProjectName之外有正确的一个,而在那儿则有旧的.我只需要应用此代码段即可生成一个新的干净的 main.jsbundle :

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

,然后获取文件main.jsbundle和资产文件夹,并将它们放在/ios/ProjectName内

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

非常感谢您的帮助.

这篇关于使用React Native iOS Release Build不会加载新代码,但是版本会加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆