模块 HMRClient 不是 Linux 中注册的可调用模块(调用启用)

Ana*_*d S 2 reactjs react-native

在此处输入图片说明

首先,当我使用 react-native init project1 创建应用程序时。我收到如下错误

无法从 windows 上的资产 index.android.bundle 加载脚本

后来我通过运行以下命令解决了这个问题 Stackoverflow link

mkdir android/app/src/main/assets

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src /主要/资源

react-native run-android

但是后来我收到这样的错误并且无法解决,模块HMRClient 不是注册的可调用模块(调用启用)

Kir*_*age 6

这是常见的问题,但捆绑应用程序不会出现问题,只需按照一些常见步骤进行操作,它对我有用。删除 node_module 文件夹并安装 npm

rm -rf node_modules && npm install

cd android && ./gradlew clean
Run Code Online (Sandbox Code Playgroud)

然后 cd .. && react-native run-android