1

I have a react native version 0.61.4 project. I completed this project last year 2021 and everything was built and ran fine. Just yesterday, almost about a year now, I decided to build this project because I wanted to continue from where I left off last year.

I ran the command "npx react-native run android" command, and the build failed reason was: Execution failed for task ':@react-native-community_slider:compileDebugJavaWithJavac'

I did a series of google searches on this, and I discovered from within this thread: https://github.com/callstack/react-native-slider/issues/82, that I needed to do the following:

  1. npx install --save-dev jetifier
  2. npx jetify

I did this and I am still getting the same result.

Now I did this because I thought the issue may be a result of the package "@react-native-community/slider". So I replaced the package with "react-native-slider" and removed the previous package.

I ran "npx react-native run android" again. And this time I got the error:

Execution failed for task ':react-native-orientation:compileDebugJavaWithJavac', since react-native-orientation is one of the packages I have installed in my node modules.

Now all this I am just discovering after not touching this project for a year, and the project was building and running successfully since then.

In fact I did "cd android && ./gradlew --clean" and find ~/.gradle -type f -name "*.lock" -delete

My react-native version is 0.61.4 My android studio version is 2.3.1

Any help provided to help get me to get my android build successful will be greatly appreciated. PS iOS builds successfully.

npx install --save-dev jetifier npx jetify cd android && ./gradlew --clean find ~/.gradle -type f -name "*.lock" -delete

I was expecting the build to succeed, but instead, I kept getting, failed builds with 'compileDebugJavaWithJavac'

Adelaja
  • 11
  • 1
  • Does this answer your question? [Android Build Failure: Common Issue- Failed to install the app. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081](https://stackoverflow.com/questions/74334162/android-build-failure-common-issue-failed-to-install-the-app-error-command-f) – Thanhal P A Nov 07 '22 at 07:14
  • 1
    Thanks so much @Thanhal. That did resolve my issue. It seems like it was a global react native compile build problem. But nonetheless, the link above that you provided really did resolve my issue. However, since I was using an android build.gradle version that was 6.1 and below and my react-native version was 0.61.4 I used the second prescribed solution, And then I ran into a problem where my react-native-admob did had a comple build issue as well. After some google searches I found this solution: – Adelaja Nov 08 '22 at 13:53

0 Answers0