为了账号安全,请及时绑定邮箱和手机立即绑定

React Native,为什么 react-native run-android 不工作?

React Native,为什么 react-native run-android 不工作?

潇潇雨雨 2023-05-25 18:19:09
我正在尝试运行命令react-native run-android,但它抛出错误。我正在关注我遵循的每一步的文档,但它不起作用,我认为它没有选择路径,但它设置为 doc 中所示。谁能告诉我怎么了?info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.(node:12536) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency(Use `node --trace-warnings ...` to show where the warning was created)Jetifier found 967 file(s) to forward-jetify. Using 4 workers...info Starting JS server...'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.info Launching emulator...'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.'C:\Users\Danger' is not recognized as an internal or external command,operable program or batch file.这是我在 android 中运行 react native 后得到的错误
查看完整描述

2 回答

?
摇曳的蔷薇

TA贡献1793条经验 获得超6个赞

做这些。

  1. 确保 JDK 版本为 8 或更新版本。

  2. 确保正确设置了 android 路径。

  3. 删除 android/build 和 android/app/build 文件夹。

编辑:如果 JDK 版本是 14并且 gradle 版本低于 6.3您必须将 JDK 降级到 11 或将 gradle 升级到 6.3 以上


查看完整回答
反对 回复 2023-05-25
?
慕勒3428872

TA贡献1848条经验 获得超6个赞

你有 RN 启动模拟器时遇到问题。所以你可能需要自己启动它,或者连接真实设备


查看完整回答
反对 回复 2023-05-25
  • 2 回答
  • 0 关注
  • 182 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信