模块 AppRegistry 不是仅在发布配置中注册的可调用模块 [英] Module AppRegistry is not a registered callable module only in Release configuration
问题描述
几天前,我们的 IOS 发布版本出现了问题.我们得到了
Few days ago we had problem with our release build for IOS. We were getting
Module AppRegistry 不是注册的可调用模块
Module AppRegistry is not a registered callable module
错误.在调试配置中一切顺利.
error. In Debug configuration everything went well.
推荐答案
一段时间后,我们发现当您在开发配置中运行代码时,您的 index.js 已创建并通过本地主机连接提供给设备.但是当你在发布时,你使用
After some time we found out that when you run your code in develop configuration your index.js is created and provisioned to device via localhost connection. But when you're in release, you use
react-native-xcode.sh
react-native-xcode.sh
脚本作为 xcode 中的构建步骤.此脚本为您创建 index.js.大问题是,如果此脚本找不到您的应用程序入口点,它不会失败,它会在没有任何模块的情况下成功构建 index.js.在这种情况下,只需将入口点添加到您的应用程序即可构建步骤.
script as a build step in xcode. This script creates index.js for you. BIG problem is that if this script can't find your entry point to the application, it doesn't fail, it builds index.js successfully without any modules. In that case, just add entry point to your application to build step.
这篇关于模块 AppRegistry 不是仅在发布配置中注册的可调用模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!