如yarn android 运行到android studio上失败

mac电脑:yarn android 运行到android studio上,项目跑不起来,模拟器能启动如下图错,大家帮我看看呢,实在是无能为力了,网上搜了好多方法都不行,但是运行到真机上项目是可以正常启动,唯独安卓模拟器不行。有遇到相同问题的小伙伴戳一戳我~

img

在创建的项目目录/android/app/build.gradle里修改

project.ext.react = [
    // enableHermes: false,  // clean and rebuild if changing
    entryFile:'index.js',
    bundleAssetName:'index.android.bundle',
    bundleInDebug:true,
    bundleInBeta:true
]

修改之后,重启,应该就可以了。

可以在创建的项目目录/android/app/build.gradle里修改
project.ext.react = [
// enableHermes: false, // clean and rebuild if changing
entryFile:'index.js',
bundleAssetName:'index.android.bundle',
bundleInDebug:true,
bundleInBeta:true
]
修改之后,重启

卸载手机上的App,重新运行yarn android。