无法加载脚本。请确保您正在运行Metro服务器(React Native)。

huangapple go评论49阅读模式
英文:

Unable to load script.Make sure you are either running a Metro server ( React Native )

问题

当我打开两个终端时:

  1. npx react-native start
  2. npx react-native run-android

实际上,在运行 run-android 时没有出现错误,但在第一个窗口中,Metro Bundler 不起作用。

  1. 我尝试从设备/模拟器中删除应用程序,但没有起作用。
  2. 我尝试删除 .gradle 文件夹,运行 ./gradlew clean,然后再次尝试运行,但仍然显示相同的问题。
英文:

when i open 2 terminal

  1. npx react-native start
  2. npx react-native run-android

actually there are no error while running run-android,
but at the first window, metro bundler doesn't work

  1. I try to delete the application from device / emulator, doesn't work at all
  2. I try delete .gradle folder and run ./gradlew clean, and try to run again but still show the same issue

答案1

得分: 0

I have fix this issue by removing this line:

app/src/main/AndroidManifest.xml 中删除以下内容:

android:networkSecurityConfig="@xml/network_security_config"

英文:

I have fix this issue by removing this line:

android:networkSecurityConfig="@xml/network_security_config"

From app/src/main/AndroidManifest.xml

huangapple
  • 本文由 发表于 2023年6月9日 04:55:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76435634.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定