4

Im using react navigation v5.. installed all the dependencies.. now Im getting above error.. FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-screens:compileDebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException

* 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

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
Arun.k
  • 165
  • 1
  • 2
  • 11

3 Answers3

4

Run this command in your terminal

  1. cd android

// to check if there are any deamon running.

  1. ./gradlew --status or .\gradlew --status
  2. ./gradlew --stop
  3. ./gradlew clean
  4. cd ..

// then restart the server

1

I think this issue is still open on GitHub issues -> View

If your React Native Version < 0.60 then you can use Jetifier to solve this issue

How to use Jetifier to solve ?

  1. yarn add --dev jetify
  2. Then in your package.json scripts add:
    • "postinstall": "jetify"
  3. yarn jetify

If your React Native Version 0.60 > then try this

cd android && ./gradlew clean
Akila Devinda
  • 5,054
  • 3
  • 19
  • 35
1

it do it when you upgrade your react-native version to 0.69.1 or higher insert the kotlin classpath to build.gradle of app(android\build.gradle) : dependencies { ..... classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10") ----- this line ..... // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }

sorry for my english

Max Ngassa
  • 11
  • 2
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 31 '22 at 14:51