Error trying to run React-Native run-android

Asked

Viewed 530 times

-1

I am starting now at React and have created a React Native project for study. When trying to run with 'React-Native run-android' it trims the error below. Can anyone help me? I don’t know how to fix it. Thank you!

E: projects-React instagram>React-Native run-android info Running jetifier to migrate Libraries to Androidx. You can disable it using "-no-jetifier" flag. Jetifier found 864 file(s) to forward-jetify. Using 4 Workers... info Starting JS server... info Installing the app...

Task :app:compileDebugJavaWithJavac FAILED

Deprecated Gradle Features Were used in this build, making it incompatible with Gradle 6.0. Use '-Warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 13 actionable tasks: 2 executed, 11 up-to-date

FAILURE: Build failed with an Exception.

  • What Went Wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

    Could not find tools.jar. Please check that C: Program Files Java jre1.8.0_231 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 11s

error Failed to install the app. Make sure you have the Android Development Environment set up: https://facebook.github.io/react-native/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.

  • What Went Wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

    Could not find tools.jar. Please check that C: Program Files Java jre1.8.0_231 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 11s

at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (E:\projetos-react\instagram\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (E:\projetos-react\instagram\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (E:\projetos-react\instagram\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

1 answer

0

Hello, Try to check if the java environment variable "JAVA_HOME" is properly configured by pointing to where jdk is

I just had this problem and solves by fixing this environment variable.

  • Okay. I’ll try. Thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.