不变违规:requireNativeComponent:在 UImanager 中找不到 'VRTText'

Invariant Violation: requireNativeComponent: 'VRTText' was not found in the UImanager

我正在与 react-viro@2.17 react-native@0.59.3 一起构建 AR 应用程序。我按照文档中的步骤进行操作 Viro-Quick-Start-Windows and when I try to bundle and build the app it's showing this error. I also referred to Viromedia/viro 但它不起作用。

当我启动应用程序时,这是我看到的屏幕

当我 select AR 在期望的体验中显示以下错误消息

我按照以下步骤修复了这个错误

  • 转到:node_modules/metro-config/src/defaults/backlist.js 并替换

sharedBlacklist

有了这个:

var sharedBlacklist = [
  /node_modules[\/\]react[\/\]dist[\/\].*/,
  /website\/node_modules\/.*/,
  /heapCapture\/bundle\.js/,
  /.*\/__tests__\/.*/
];

打开一个终端然后运行:

react-native start
  • 等待依赖图加载,

再打开一个终端运行:

react-native run-android --variant=gvrDebug