react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Execution failed for task ':app:compileDebugKotlin'.

Open gkasireddy202 opened this issue 9 months ago • 5 comments

Description

Getting the below error I upgraded the project from 0.68.7 to 0.73.2

Execution failed for task ':app:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details

Steps to reproduce

react-native run-android

React Native Version

0.73.2

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Memory: 38.38 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.3
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.03.13.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/gopi/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
    Build Tools:
      - 29.0.2
      - 30.0.3
      - 33.0.1
      - 34.0.0
    System Images:
      - android-29 | Google APIs Intel x86 Atom
      - android-29 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-32 | Google APIs Intel x86 Atom_64
      - android-32 | Google Play Intel x86 Atom_64
      - android-33 | Google APIs Intel x86 Atom_64
      - android-33 | Google Play Intel x86 Atom_64
    Android NDK: Not Found
IDEs:
  Android Studio: 2021.2 AI-212.5712.43.2112.8609683
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.2
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/gopi/.rvm/rubies/ruby-2.7.6/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.2
    wanted: 0.73.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

Getting the below error I upgraded the project from 0.68.7 to 0.73.2

rebuild the project in Android studio

Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

Reproducer

No Git url

Screenshots and Videos

No response

gkasireddy202 avatar May 08 '24 07:05 gkasireddy202

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

github-actions[bot] avatar May 08 '24 07:05 github-actions[bot]

:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

github-actions[bot] avatar May 08 '24 07:05 github-actions[bot]

We recently upgraded my project to 0.73.2. iOS builds successfully and issues with Android.

gkasireddy202 avatar May 08 '24 07:05 gkasireddy202

Your Android code is not compiling. We need to full build log to see what happened here.

cortinico avatar May 08 '24 10:05 cortinico

@cortinico - Thanks for the reply.The issue with namespace in build.gradle. Now i am getting this error.I am using distributionUrl=https://services.gradle.org/distributions/gradle-8.3-all.zip. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

gkasireddy202 avatar May 08 '24 10:05 gkasireddy202

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

This is a warning, not an error, you can ignore it (also is caused by the Android/Google toolchain). Closing as this is solved

cortinico avatar May 10 '24 23:05 cortinico

@gkasireddy202 I have the same issue and I am using Gradle 8.8. My react native app works fine in Expo GO. But when I build it and run it on an android device it goes blank. Running npm run android fails with this output: `

Task :app:compileDebugKotlin FAILED << FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details `

Here is my package.json:

{ "name": "Médicaments", "version": "1.0.0", "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web" }, "dependencies": { "@expo-google-fonts/lato": "^0.2.3", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/native": "^6.1.17", "@react-navigation/stack": "^6.3.29", "expo": "~51.0.9", "expo-camera": "^15.0.10", "expo-font": "~12.0.6", "expo-status-bar": "~1.12.1", "expo-system-ui": "^3.0.4", "expo-updates": "~0.25.15", "react": "18.2.0", "react-native": "0.74.1", "react-native-gesture-handler": "^2.16.2", "react-native-picker-select": "^9.1.3", "react-native-safe-area-context": "4.10.1", "react-native-screens": "3.31.1", "react-native-svg": "15.2.0", "react-native-webview": "13.8.6", "react-navigation": "^5.0.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@types/react": "~18.2.45", "@types/react-navigation": "^3.4.0", "typescript": "~5.3.3" }, "private": true }

AbdessamadAe avatar Jun 02 '24 17:06 AbdessamadAe

@AbdessamadAe - I upgraded the expo manually instead of auto-linking.

gkasireddy202 avatar Jun 03 '24 06:06 gkasireddy202

@gkasireddy202 Expo version is updated. I initiated a new blank project and tried to build, it had same issue. Any suggestions on how to fix that?

AbdessamadAe avatar Jun 03 '24 13:06 AbdessamadAe

Can you please try to run the app in debug mode then you will know the exact error. I found my issue like that only.

gkasireddy202 avatar Jun 03 '24 14:06 gkasireddy202

Did you ever resolve this issue?

neilhendricks avatar Jul 06 '24 01:07 neilhendricks

Check it out app/build.gradle namespace

winwonwen avatar Aug 15 '24 10:08 winwonwen

I have same issue

uguraktas avatar Sep 02 '24 11:09 uguraktas

I built a new express project and copied my code. That resolved it.

AbdessamadAe avatar Sep 02 '24 12:09 AbdessamadAe

I am using expo (managed workflow). After deleting the android folder and then running the app fixed the issue for me.

Nikit-Singh avatar Sep 24 '24 01:09 Nikit-Singh