Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':react-native-gesture-handler:compileDebugKotlin'

Tags:

react-native

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-gesture-handler:compileDebugKotlin'.

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

* 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]https://help.gradle.org)

BUILD FAILED in 3m 54s

at makeError (C:\Users\Zsola\Desktop\NoruHotels\node_modules\execa\index.js:174:9)
at C:\Users\Zsola\Desktop\NoruHotels\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\Zsola\Desktop\NoruHotels\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\Zsola\Desktop\NoruHotels\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details.

i tried this with ai

This error occurs when there is an issue with the Kotlin compilation process for the react-native-gesture-handler library. Here are some steps you can take to resolve the issue:

  1. Make sure that you have the correct version of Kotlin Gradle Plugin installed. You can check the version in your project's build.gradle file under dependencies.

  2. Try cleaning and rebuilding your project by running the following commands in your project directory:


cd android
./gradlew clean
cd ..
react-native run-android

  1. If the issue persists, try updating your Kotlin version by adding the following line to your project's build.gradle file:

ext.kotlin_version = '1.5.21'

Then update the Kotlin Gradle Plugin version to match:

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"

  1. If none of the above steps work, try disabling Kotlin compilation for the react-native-gesture-handler library by adding the following line to your project's build.gradle file:
configurations.all {
    exclude group: 'com.facebook.react', module: 'react-native-gesture-handler'
}

Then run react-native run-android again.

Hopefully one of these steps will resolve the issue for you.

like image 563
Solomon zefine Avatar asked Mar 22 '26 17:03

Solomon zefine


1 Answers

I solved it by upgrading my react-native-gesture-handler to version 2.9.0.

  1. Update package.json: Open your project's package.json file and find the dependency for react-native-gesture-handler. Change the version number to "2.9.0" (don't forget to remove ^). It should look like this:

    "dependencies": {
      "react-native-gesture-handler": "2.9.0",
      // other dependencies...
    }
    
  2. Uninstall the node_modules folder.

  3. Run npm install

  4. Try building your project now

like image 128
Ibrahim Avatar answered Mar 25 '26 06:03

Ibrahim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!