FabricViewStateManager:在没有 StateWrapper 的情况下调用 setState

Bob*_*b O 12 android reactjs react-native react-native-ble-plx

我是一名 iOS 开发人员,第一次使用 React-native 涉足 Android 领域。

\n

我正在创建一个使用蓝牙le的react-native应用程序,使用polidieas react-native-ble-plx库。iOS 应用程序运行良好,蓝牙扫描并检测设备。当我在 Android 上运行时,它开始扫描,并收到错误“FabricViewStateManager:在没有 StateWrapper 的情况下调用 setState”,并且找不到此错误语句的任何文档或帮助。

\n

两个问题:

\n
    \n
  1. 有没有人在 Anmdroid 上运行 React-Native Apps 时看到此错误:FabricViewStateManager:在没有 StateWrapper 的情况下调用 setState。

    \n
  2. \n
  3. 有人对如何隔离错误发生的位置有任何想法吗?

    \n
  4. \n
\n

这是出现错误之前的控制台:

\n
I/BluetoothAdapter: STATE_ON\nI/BluetoothAdapter: STATE_ON\nI/BluetoothAdapter: STATE_ON\nI/BluetoothAdapter: STATE_ON\nD/BluetoothLeScanner: Start Scan with callback\nD/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=13 mScannerId=0\nI/ReactNative: [GESTURE HANDLER] Initialize gesture handler for root view com.facebook.react.ReactRootView{67ef486 V.E...... ......ID 0,0-1080,2019 #1}\n**E/unknown:FabricViewStateManager: setState called without a StateWrapper**\nI/ReactNativeJS: \xe2\x94\x90 %c action %cCHANGE_STATUS %c@ 20:36:54.384\nI/ReactNativeJS: \xe2\x94\x82 '%c prev state', 'color: #9E9E9E; font-weight: bold', { BLEs: \n       { BLEList: [],\n         color: '#800080',\n         oldColor: '#000000',\n         intensity: 127,\n         connectedDevice: {},\n         status: 'disconnected' } }\n    \xe2\x94\x82 '%c action    ', 'color: #03A9F4; font-weight: bold', { type: 'CHANGE_STATUS', status: 'Scanning' }\nI/ReactNativeJS: \xe2\x94\x82 '%c next state', 'color: #4CAF50; font-weight: bold', { BLEs: \n       { BLEList: [],\n         color: '#800080',\n         oldColor: '#000000',\n         intensity: 127,\n         connectedDevice: {},\n         status: 'Scanning' } }\n    \xe2\x94\x98 \n    \xe2\x94\x90 %c action %cADD_BLE %c@ 20:36:54.391\nI/ReactNativeJS: \xe2\x94\x82 '%c prev state', 'color: #9E9E9E; font-weight: bold', { BLEs: \n       { BLEList: [],\n         color: '#800080',\n         oldColor: '#000000',\n         intensity: 127,\n         connectedDevice: {},\n         status: 'Scanning' } }\nI/ReactNativeJS: \xe2\x94\x82 '%c action    ', 'color: #03A9F4; font-weight: bold', { type: 'ADD_BLE',\n      device: \n
Run Code Online (Sandbox Code Playgroud)\n

jet*_*ter 2

据我所知,目前还没有答案。facebook/react-native请参阅GitHub 中针对该项目发布的此问题: https ://github.com/facebook/react-native/issues/32070 。

如果您正在使用它,它可能与 相关react-native-reanimated,这也是最新版本 RN 发生一些神秘崩溃的原因(例如,请参见此处此处)。他们显然已经解决了最近版本2.2.2(21 月 14 日)及其2.3.0-alpha.