React Native,为什么 react-native 运行-android 不工作?
React Native, why is react-native run-android not working?
我正在尝试 运行 命令 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.
'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.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
那是我在 运行ning react native in android
之后得到的错误
做这些。
- 确保 JDK 版本为 8 或更高版本。
- 确保 android 路径设置正确。
- 删除 android/build 和 android/app/build 个文件夹。
编辑:
如果 JDK 版本 是 14 并且 gradle 版本 小于 6.3 您必须降级 JDK到11或升级gradle到6.3以上
您的问题似乎与:
还说你的 RN 启动模拟器有问题。所以你可能需要自己启动它,或者连接真实设备
我正在尝试 运行 命令 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.
'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.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 17s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
那是我在 运行ning react native in android
之后得到的错误做这些。
- 确保 JDK 版本为 8 或更高版本。
- 确保 android 路径设置正确。
- 删除 android/build 和 android/app/build 个文件夹。
编辑: 如果 JDK 版本 是 14 并且 gradle 版本 小于 6.3 您必须降级 JDK到11或升级gradle到6.3以上
您的问题似乎与:
还说你的 RN 启动模拟器有问题。所以你可能需要自己启动它,或者连接真实设备