关于reactnativey安卓运行插件报错com.facebook.react.bridge不存在和符号找不到
之前运行好好的reactnative项目,突然运行报错

哭死==_==
试过了很多方法都不行
后面看到了一篇文章,抱着试一试的态度竟然解决了
解决方法:
在项目下的buld.gradle文件中添加如下代码,即可成功编译
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}

浙公网安备 33010602011771号