欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

react native windows 启动报错处理unble to load script.Make sure you are either running a Metro server...

程序员文章站 2022-07-02 23:34:17
react native项目初始化启动报错。报错如下图所示 解决办法: 找到reactDemo\android\app\build.gradle里面的build.gradle文件,搜索project.ext.react,并找到如下jsproject.ext.react = [ enableHermes: false, // clean and rebuild if changing]修改为project.ext.react = [ enableHermes:......

react native项目初始化启动报错。报错如下图所示

    react native windows 启动报错处理unble to load script.Make sure you are either running a Metro server...

解决办法: 找到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

解决来源: https://github.com/facebook/react-native/issues/22076

react native windows 启动报错处理unble to load script.Make sure you are either running a Metro server...

本文地址:https://blog.csdn.net/Lschange/article/details/107974261

相关标签: react native