Xcode不能反映来自react-native的最新应用程序代码 [英] Xcode not reflecting latest app codes from react-native

查看:61
本文介绍了Xcode不能反映来自react-native的最新应用程序代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,事实证明这不是AppStore的问题,我以Xcode发布模式运行了该应用程序,并且我在模拟器上运行了相同的旧版本,但我不知道为什么,但是Xcode没有运行最新的jsbundle.

Okay turns out this is not a problem with AppStore i ran the app from Xcode release mode and i got the same old version running on the simulator i don't know why but Xcode is not running the latest jsbundle.

现在我找到了

now i found this question with the same problem and tried following it i ran this command: react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios/assets and put the newly generated main.jsbundle inside /ios/ProjectName but still when i ran the code from Xcode it gives me an old version i also tried cleaning and rebuilding and removing derived data and building again with same result

我最近将一个应用程序上载到Apple App Store,但似乎有问题,这是我上载该应用程序并获得批准并说可以出售的情况,但是当我去应用程序商店并下载该应用程序时这只是该应用程序的先前版本,我看不到该应用程序上进行的所有新更改...这对我来说有点奇怪,我还在新版本中上传了新徽标,并且该徽标已更新..该版本也在应用商店上更新,列出了以前的版本是1.0,此版本显示的是1.1,"Whats new"(最新消息)部分也已更新...我还使用此新版本更改了预览和屏幕截图,该新版本也反映在应用程序商店列表中,但仅当我下载该应用程序时,我才获得以前的版本.

i recently uploaded an app to the Apple App Store but seems to be having issues with it here's the case i uploaded the app and it got approved and says its ready for sell but when i go to the app store and download the app it is just the previous version of the app and i don't see all the new changes made on the app...this is kind of strange for me i have also uploaded a new logo on the new version release and the logo is updated..the version is also updated on the app store listing the previous one was 1.0 this one shows 1.1 and the "Whats new" section is also updated...i have also changed the preview and screenshots with this new version that is also reflected on the app store listing but only when i download the app i get the previous version.

我尝试先连接到我的应用商店,然后再进行活动",然后我看到我的内部版本在其中,并带有正确的上载日期和内部版本号...这里是否缺少我的东西?

i tried going to my app store connect and then Activity and i see my build is there with a correct uploaded date and build numbers...is there something i am missing here?

谢谢

推荐答案

这是一个详细的反复试验过程,试图确定哪一步对解决该问题至关重要.

Here is a detailed trial-and-error process trying to pin down which step is crucial to resolve the issue.

我从代码库开始,其中 npx react-native run-ios --configuration Release 确实反映了代码库中的新变化.随后的每一轮都跟着前一轮,即前一轮的结束状态可能会影响下一轮.

I start from the code base where npx react-native run-ios --configuration Release does reflect new changes in the code base. Each subsequent round follows the previous round, i.e., the previous round's end state might affect the next round.

  • 从Xcode和文件系统中删除 main.jsbundle .
  • 更改React本机代码库.
  • 运行 npx react-native run-ios --configuration Release
  • 失败,新的更改未反映在版本中.
  • Remove main.jsbundle from both Xcode and the file system.
  • Make changes to the react native code base.
  • Run npx react-native run-ios --configuration Release
  • FAIL, new changes not reflected in the build.
  • 尝试 npm start---reset-cache
  • 运行 npx react-native run-ios --configuration Release
  • 失败,新的更改未反映在版本中.
  • Try npm start -- --reset-cache
  • Run npx react-native run-ios --configuration Release
  • FAIL, new changes not reflected in the build.
  • 尝试"Cmd + Shift + K";在Xcode中清理构建.
  • 运行 npx react-native run-ios --configuration Release
  • 失败,新的更改未反映在版本中.
  • Try "Cmd + Shift + K" within Xcode to clean build.
  • Run npx react-native run-ios --configuration Release
  • FAIL, new changes not reflected in the build.
  • 运行 react-native包--entry-file index.js --platform ios --dev否--bundle-output ios/your_app_name/main.jsbundle
  • 运行 npx react-native run-ios --configuration Release
  • 失败,新的更改未反映在版本中.
  • Run react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/your_app_name/main.jsbundle
  • Run npx react-native run-ios --configuration Release
  • FAIL, new changes not reflected in the build.
  • 在Xcode中,将 main.jsbundle 文件手动添加到您的应用文件夹中.在您的项目中,右键单击标有应用程序名称的文件夹,选择将文件添加到your_app_name",然后在应用程序文件夹中添加 main.jsbundle .请注意,我们在此处添加的捆绑包是在第4轮中创建的.
  • 运行 npx react-native run-ios --configuration Release .在命令执行期间的输出消息中,会显示一条新消息:正在复制/.../your_app_name/ios/your_app_name/main.jsbundle" .
  • 成功,现在显示新更改.这表明此回合使用的是在第4轮中创建的捆绑软件,而不是缓存在某处的某些早期版本.
  • In Xcode, manually add the main.jsbundle file to your app folder. In your project, right click on the folder baring your app's name, choose "Add file to your_app_name", and add main.jsbundle in the app folder. Note that the bundle we add here was created in Round 4.
  • Run npx react-native run-ios --configuration Release. In the output message during command execution, a new message shows up: "Copying /.../your_app_name/ios/your_app_name/main.jsbundle".
  • SUCCCESS, new changes are showing now. This suggests that the bundle created in Round 4 is used for this build, instead of some previous version cached somewhere.
  • 对react本机代码库进行另一个更改.
  • 直接运行 npx react-native run-ios --configuration Release ,而无需手动构建捆绑包.复制消息未显示.
  • 失败,新的更改未反映在版本中.请注意,Xcode和文件系统中都存在 main.jsbundle .
  • Make another change in the react native code base.
  • Directly run npx react-native run-ios --configuration Release without building the bundle manually. The copy message does not show up.
  • FAIL, new changes not reflected in the build. Note that main.jsbundle exists in both Xcode and the file system.
  • 运行 watchman watch-del-all 以清除 watchman 的缓存.
  • 运行 npx react-native run-ios --configuration Release .复制消息未显示.
  • 失败,新的更改未反映在版本中.
  • Run watchman watch-del-all to clean cache of watchman.
  • Run npx react-native run-ios --configuration Release. The copy message does not show up.
  • FAIL, new changes not reflected in the build.
  • 运行 react-native捆绑软件--entry-file index.js --platform ios --dev false --bundle-output ios/your_app_name/main.jsbundle 重建捆绑软件.
  • li>
  • 无需修改Xcode,直接运行 npx react-native run-ios --configuration Release .这次,出现复制消息.
  • 成功,现在显示最新更改.
  • Run react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/your_app_name/main.jsbundle to rebuild a bundle.
  • Without tinkering with Xcode, directly run npx react-native run-ios --configuration Release. This time, the copy message shows up.
  • SUCCCESS, the latest changes are showing now.

至少在我的笔记本电脑上,每个新版本的构建都需要手动构建脱机捆绑包,以反映react native代码库中的最新更改.仅当将捆绑包添加到Xcode的app文件夹中时,构建捆绑包才有效.看来我们只需要将捆绑软件添加到Xcode一次即可.

At least on my laptop, manually building an offline bundle is required for each new release build to reflect the latest changes in the react native code base. Building the bundle only works if the bundle is added to the app folder in Xcode. It seems that we only need to add the bundle to Xcode once.

另一个需要注意的是,不同的Xcode版本的行为可能会有所不同.

Also a big caveat is that the behavior might be different with a different Xcode version.

  • macOS Catalino 10.15.6
  • Xcode 11.6
  • 本机0.61.5

这篇关于Xcode不能反映来自react-native的最新应用程序代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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