繁体   English   中英

“npx react-native init client”在执行时在 Android 上失败。 找不到工具。jar。 反应原生 0.62.2

[英]“npx react-native init client” fails on Android while executing. Could not find tools.jar. React Native 0.62.2

系统:Windows 10
节点JS:v13.8.0
反应原生:0.62.2
反应:“16.11.0”

typescript 模板也会发生这种情况

在我运行npm run android ,我有这些日志:

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" 
flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
14 actionable tasks: 6 executed, 8 up-to-date

error Failed to install the app. Make sure you have the Android development environment set up: 
https://reactnative.dev/docs/getting-started.html#android-development-environment. Run CLI with -- 
verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.


ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_251 contains a valid JDK installation

固定的。
问题出在

ERROR: Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_251 contains a valid JDK installation

我刚刚将tools.jarC:\Program Files\Java\jdk1.8.0_241\jre\lib复制到 Z0D61F8370CAD1D412F80B84D143E121.0Files\Program Files\Java\jdk1.8.0_241\jre\lib C:\Program Files\Java\jre1.8.0_251\lib

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM