在过去的 1.5 天左右,我试图让 react-native-track-player 工作,但我无法实现。无论我尝试什么,我总是最终遇到相同的错误块:
ERROR TypeError: null is not an object (evaluating 'TrackPlayer.RATING_HEART')
ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). 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.
我用react-native expo和 'normal' react-native(根据 react-native docu)设置它JS和TS。对于我尝试过的所有变体:
- 删除/重新安装节点模块
npm cache verify(如此处所述),(来自此处)和其他一些缓存重置/删除的东西。react-native start --reset-cache- 我已经从他们的 GitHub 存储库中复制了示例。
- 我几乎更新和/或重新安装了每个库(包括
node)
所有这些努力都以完全相同的错误告终。
所以你,我真的不知道该怎么办了。一般来说,我是 react-native 和 app dev 的初学者。所以说实话,我犯的错误很可能是超级愚蠢/简单的。但我就是找不到。如果有任何建议,我将不胜感激。
编辑 2:解决方案 -react-native删除jcenter之间v0.64 v0.65是我所有问题的根源,请查看下面的答案以获取详细信息。





