Skip to content

Metro正常 + 模拟器正常,metro报错 No apps connected,app报错 unable to load script #944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Sawtone opened this issue Apr 12, 2025 · 8 comments

Comments

@Sawtone
Copy link

Sawtone commented Apr 12, 2025

请按以下格式提供问题的相关信息。

问题的具体描述

npx react-native start 
yarn android
adb devices

均显示运行正常

报错如下

Image

请描述完整的环境/版本信息

Image

Image

预期结果

App 点击后正常显示demo模板

之前成功显示过,但不太清楚为什么现在两者无法正常连接

如果使用打包可以正常运行,但不太合理,因为开发环境按道理不用打包

麻烦大佬们了,感谢

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

补一下环境变量:

Image

Path:

Image

Image

@sunnylqm
Copy link

在命令行里运行
adb reverse tcp:8081 tcp:8081
再reload

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

在命令行里运行 adb reverse tcp:8081 tcp:8081 再reload

试过的,ai也分析过,我觉得蛮有道理,但是还是没什么用

感觉确实还是因为 Metro 报错 No apps connected 的原因

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

Image

Image

Image

Image

@sunnylqm
Copy link

No apps connected不是原因,是结果(因为连不上)
建议重启模拟器试试

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

No apps connected不是原因,是结果(因为连不上) 建议重启模拟器试试

试了下哥,还是不行,您说有没有可能是0.79.0的问题

或者我可以push一下方便复现,复现的话应该是就不是本地环境问题了

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

2025年4月12日 19:11:17

使用PowerShell替换cmd(应该无关),换了个API 24 的新模拟器,Service:Android Open Sourece,无报错

Image

原模拟器为:API 36,Service:Google Play Store

我去控制变量多测几个,看看是高级别API冲突还是 Google Environment 的问题

@Sawtone
Copy link
Author

Sawtone commented Apr 12, 2025

2025年4月12日 19:30:05

环境:PowerShell

尝试了 API 35,Service:Google Play Store,无报错

重新尝试 API 36,Service:Google Play Store,报错

删除 API 36 Simulator,重新创建相同配置模拟器,API 36,Service:Google Play Store,无报错

应该是 API 36 Simulator 的偶然错误,解决方法:重开模拟器/API降级

感谢大佬!之后有事还得来麻烦您~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants