错误不变违规:无法调用 JavaScript 模块方法 AppRegistry.runApplication()

Shu*_*uru 5 javascript android typescript babeljs react-native

我正在尝试在我的 Android 模拟器中运行其他人的反应本机项目。安装所有依赖项并复制并粘贴 src 文件夹后,我收到此错误,我不知道该怎么做,因为我已经尝试解决此问题 2 天了。`

 ERROR  Error: Failed to initialize react-native-reanimated library, make sure you followed installation steps here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/
1) Make sure reanimated's babel plugin is installed in your babel.config.js (you should have 'react-native-reanimated/plugin' listed there - also see the above link for details)
2) Make sure you reset build cache after updating the config, run: yarn start --reset-cache, js engine: hermes
 ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
 ERROR  Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
        A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes`
Run Code Online (Sandbox Code Playgroud)

我尝试了很多解决方案,例如 cd ./android && ./gradlew clean.. 等,但没有命令有用。

小智 7

我收到这条消息,显然,您的代码中有一个错误,它只是不知道出了什么问题。

我所做的是使用expo start -c清除缓存来运行我的项目,然后真正的错误被打印在我的终端上。

希望我能帮助你!