Arun.k
Arun.k

Reputation: 203

Task :react-native-screens:compileDebugJavaWithJavac FAILED

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

Upvotes: 6

Views: 17109

Answers (3)

Max Ngassa
Max Ngassa

Reputation: 11

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

Upvotes: 1

user19269148
user19269148

Reputation: 91

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

Upvotes: 9

Akila Devinda
Akila Devinda

Reputation: 5502

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

Upvotes: 1

Related Questions