react native项目初始化启动报错。报错如下图所示
解决办法: 找到reactDemo\android\app\build.gradle里面的build.gradle文件,搜索project.ext.react,并找到如下js
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
]
修改为
project.ext.react = [
enableHermes: false, // clean and rebuild if changing
bundleAssetName: "index.android.bundle",
bundleInDebug: true,
bundleInRelease: true
]
然后重新启动yarn android 或者npm run android