为什么在 Android 模拟器中单击“调试”时 React Native 应用程序会崩溃?

Sud*_*amy 4 javascript android facebook react-native

在 Android 模拟器中单击“调试”时,React Native 应用程序显示错误

尝试在空对象引用上调用接口方法 java.lang.String com.facebook.react.bridge.Cat alystInstance.getSourceURL('

以下是错误截图

模拟器截图:
1

调试器截图:
2

单击重新加载时,应用程序崩溃并失去与调试器的连接。

尝试在模拟器中卸载并重新安装 apk 并 cd android ./gradlew clean。

还是同样的错误。

Tha*_*P A 5

我遇到了同样的问题,这是由于“react-native-reanimated”包造成的(在他们的文档中提到,react-native-reanimated 不再可能进行远程调试:React Native Reanimated Known Problems and Limitations)和解决方案就是使用 Flipper 来调试:Debugging React Native apps with Flipper