6

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
3
  • Add your react and react native versions to your question Commented Feb 20, 2020 at 6:08
  • "react": "16.9.0", "react-native": "0.61.5", Commented Feb 20, 2020 at 7:02
  • have same issue Commented Feb 25, 2020 at 21:41

3 Answers 3

9

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

Sign up to request clarification or add additional context in comments.

Comments

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

6 Comments

@Arun.k try to remove node_modules and reinstalling it. Then run
you mean should i delete node_modules folder or delete depednencies ?
Yes delete node_modules folder and install it using npm install
Tnx for ur response Sir... I resolved this issue by installing alpha dependencies of react navigation(next)
I do not get this error while running the app from android studio, but get it while running 'react-native run-android'
|
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

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.