【问题标题】:"npx react-native init client" fails on Android while executing. Could not find tools.jar. React Native 0.62.2“npx react-native init client”在执行时在 Android 上失败。找不到 tools.jar。反应原生 0.62.2
【发布时间】:2020-04-17 14:09:29
【问题描述】:

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

打字稿模板也会发生这种情况

在我运行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

【问题讨论】:

    标签: javascript android reactjs react-native npm


    【解决方案1】:

    已修复。
    问题出在

    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复制到C:\Program Files\Java\jre1.8.0_251\lib

    【讨论】:

      猜你喜欢
      • 2022-11-05
      • 1970-01-01
      • 2017-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-28
      • 2021-09-25
      相关资源
      最近更新 更多