升级到RN 0.62后,应用无法加载。
升级到RN 0.62后,应用无法加载。
升级到RN 0.62.2后,我使用RN升级工具从0.61.3升级,并更新了pod(甚至需要修改podspec中的一行代码才能使其正常工作:CocoaPods could not find compatible versions for pod \"ReactCommon/jscallinvoker\":)。我的应用程序构建成功,但卡在了启动画面上。在RN 0.61.3上运行良好。以下是我在metro控制台中的输出:\n
[Wed Apr 22 2020 18:22:25.108] WARN Require cycle: node_modules/react-native-af-video-player/components/index.js -> node_modules/react-native-af-video-player/components/TopBar.js -> node_modules/react-native-af-video-player/components/index.js Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle. [Wed Apr 22 2020 18:22:25.108] LOG Unable to symbolicate stack trace: Unable to resolve data for blob: (null) [Wed Apr 22 2020 18:22:25.109] LOG Running "gamefare" with {"rootTag":151,"initialProps":{}} [Wed Apr 22 2020 18:22:25.122] LOG Unable to symbolicate stack trace: Unable to resolve data for blob: (null)
\n有人遇到相同的问题吗?有什么办法可以调试?我尝试删除了node modules并重新安装了一切,但问题没有解决。当我从我的index.js
中使用console.log时,什么都没有输出。\n编辑:这是我在Xcode中的完整错误信息:\n
2020-04-24 16:46:00.478 [error][tid:com.facebook.react.JavaScript] TypeError: Object is not a constructor (evaluating 'new _reactNative.TextInput()') 2020-04-24 16:46:00.481 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: Object is not a constructor (evaluating 'new _reactNative.TextInput()') 2020-04-24 16:46:00.490 [info][tid:com.facebook.react.JavaScript] Running "gamefare" with {"rootTag":1,"initialProps":{}} 2020-04-24 16:46:00.490 [error][tid:com.facebook.react.JavaScript] Invariant Violation: "gamefare" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called. 2020-04-24 16:46:00.498 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: "myAppName" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called. 2020-04-24 16:46:00.594 [info][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: Unable to resolve data for blob: (null) 2020-04-24 16:46:00.604 [info][tid:com.facebook.react.JavaScript] Unable to symbolicate stack trace: Unable to resolve data for blob: (null)
问题原因:升级到RN 0.62后,应用程序无法加载,原因是使用的某个包(react-native-confirmation-code-field)需要更新。
解决方法:更新react-native-confirmation-code-field包,问题得到解决。如果遇到相同问题并使用了这些模块,还需要更新reac-native-firebase包。在调试时,最好逐个组件地逐步排查,当控制台日志不清晰时,将所有内容逐步移除并逐个添加组件。
感谢提供解决方法的维护者,他已经意识到了RN 0.62的问题并进行了更新。
一些用户表示遇到了相同的问题,从react native 0.61.5升级到0.63.2,更新react-native-confirmation-code-field的版本解决了问题。这个发现真是太棒了,对我也有帮助,节省了大量时间。非常感谢!