簡體   English   中英

嘗試運行使用 react-native-camera 的 android 應用程序時出錯

[英]Error when trying to run an android app that uses react-native-camera

嗨,我正在嘗試在 react native 中使用帶有 react-native-camera 的相機,但是當我運行該應用程序時,它會顯示此錯誤

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1165 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Launching emulator...
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :react-native-camera:compileMlkitDebugJavaWithJavac 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.9/userguide/command_line_interface.html#sec:command_line_warnings
98 actionable tasks: 2 executed, 96 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-camera:compileMlkitDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

* 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 10s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-camera:compileMlkitDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

* 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 10s

    at makeError (/Users/calebgarcia/Dev/Tibeo/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
    at /Users/calebgarcia/Dev/Tibeo/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (/Users/calebgarcia/Dev/Tibeo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/calebgarcia/Dev/Tibeo/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.

我在嘗試在 android 上運行反應原生應用程序時遇到了很多問題,但在 ios 上它們運行得很好。 你們有什么想法我該如何解決這個錯誤。 謝謝

  1. 首先檢查您是否安裝了什么jdk版本(到終端並通過java --version檢查)
  2. 確保您已將該 jre 路徑添加到您的環境變量中
  3. 如果您已經完成了這些條件,請點擊以下鏈接 [https://dev.to/larrydanny/could-not-find-tools-jar-4363][1]

你的問題會解決的......

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM