简体   繁体   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

System: Windows 10系统:Windows 10
NodeJS: v13.8.0节点JS:v13.8.0
React Native: 0.62.2反应原生:0.62.2
React: "16.11.0"反应:“16.11.0”

It also happens with typescript template typescript 模板也会发生这种情况

After I run npm run android , I have these logs:在我运行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

Fixed.固定的。
Problem was in问题出在

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

I just copied tools.jar from C:\Program Files\Java\jdk1.8.0_241\jre\lib into C:\Program Files\Java\jre1.8.0_251\lib我刚刚将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.

相关问题 无法在 linux 中运行 npx react-native init - unable to run npx react-native init in linux npx react-native init MyTestApp 命令未在 MAC 中安装 react-native - npx react-native init MyTestApp command is not installing the react-native in MAC 无法使用 npx react-native init 命令创建 react-native 应用程序 - can't create react-native app with npx react-native init command 为什么 npx react-native init MyApp 不起作用并且不创建 React Native 项目? - Why doesn't npx react-native init MyApp not work and doesn't create a React Native project? React Native 无法 npx init 项目,找不到模块错误 - React Native cannot npx init project, cannot find module error 我如何在无状态函数 React-Native 中使用 refs,我正在使用 React-Native 0.62.2 - How can i user refs in stateless functions React-Native, am using React-Native 0.62.2 npx react-native init 错误在 appdata 文件夹中不包含 package.json 文件 - npx react-native init error does not contain a package.json file in appdata folder npx react-native init MainApp Giving 错误(代码:'MODULE_NOT_FOUND',)。 这里有什么问题 - npx react-native init MainApp Giving error (code: 'MODULE_NOT_FOUND',) . What's the isue here npx react-native init myapp 的全新安装导致问题警告 - Fresh installation by npx react-native init myapp causes in problem warning 如何为 windows 运行 react-native? 我有一个问题:npx react-native run-android 错误 - How to run react-native for windows? I have a problem: npx react-native run-android error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM