类型错误:未定义不是对象(评估“NativeUnimoduleProxy.viewManagersNames.includes”)

Maj*_*kon 7 react-native expo

我将 expo 从 sdk 44 升级到 sdk 45,但出现了 2 个无法解决的错误。

 ERROR  TypeError: undefined is not an object (evaluating 'NativeUnimoduleProxy.viewManagersNames.includes')
 ERROR  Invariant Violation: "main" 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.
Run Code Online (Sandbox Code Playgroud)

知道如何修复它吗?该应用程序是一个托管的世博项目。

Pra*_*dka 6

以下是我为解决我的案例中的问题而遵循的两个步骤

 1. expo install expo-modules-core
 2. AppRegistry.registerComponent(() => Root); in index.js file
Run Code Online (Sandbox Code Playgroud)


小智 0

经过一番挣扎后,这对我有帮助:-D

如果您正在从旧版本安装新的 sdk45,并且在您的 React Native 应用程序中有骨架内容,请将其替换为以下内容:-> https://github.com/alexZajac/react-native-sculpture-content/issues/66