react-native-vision-camera: 🐛 RN 0.71.4 run-android ==> Task :react-native-vision-camera:compileDebugKotlin FAILED

What were you trying to do?

I am trying to install this library

“react-native-vision-camera”: “2.15.4”, “react”: “18.2.0”, “react-native”: “0.71.4”,

What happened instead?

Task :react-native-vision-camera:compileDebugKotlin FAILED

Relevant log output

FAILURE: Build completed with 2 failures.

> Task :react-native-vision-camera:compileDebugKotlin FAILED

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-vision-camera: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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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

BUILD FAILED in 44s

Device

android

VisionCamera Version

2.15.4

Additional information

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

changing kotlin version worked for me

/*
/android/build.gradle
*/
buildscript {
    ext {
    // ...
        kotlinVersion = "1.6.20"
    }
    // ...
}

Hi ! I changed kotlinVersion for 1.7.20 and this is now working !

Current working for react-native-vision-camera@3.6.4 and react-native@0.71.14 :

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 28
        compileSdkVersion = 33
        targetSdkVersion = 33
        supportLibVersion = "28.0.0"
        kotlinVersion = "1.7.20"
        ndkVersion = "23.1.7779620"

@mrousavy This issue is still coming on V3.2 latest one on Andriod

Hello, any workaround without downgrading the Kotlin version ?

I really need to use the 1.8.0 version of Kotlin

@adscud The problem is deprecated kotlin-android-extension Workaround: from file android/build.gradle remove 2 lines: classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version" & apply plugin: 'kotlin-android-extensions' and change lines if (REACT_NATIVE_VERSION >= 71) { buildFeatures { prefab true } } to buildFeatures { viewBinding = true if (REACT_NATIVE_VERSION >= 71) { prefab true } } After this you could prepare patch using patch-package. Working in my app.

Hi ! I changed kotlinVersion for 1.7.20 and this is now working !

Current working for react-native-vision-camera@3.6.4 and react-native@0.71.14 :

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 28
        compileSdkVersion = 33
        targetSdkVersion = 33
        supportLibVersion = "28.0.0"
        kotlinVersion = "1.7.20"
        ndkVersion = "23.1.7779620"

Thank you very much, I spent three days on this issue

Changing the kotlinVersion to 1.7.20 also worked for me!!

ext {
        kotlinVersion = "1.7.20"
        ...
    }

and

dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
        ...
}

changing kotlin version worked for me

/*
/android/build.gradle
*/
buildscript {
    ext {
    // ...
        kotlinVersion = "1.6.20"
    }
    // ...
}

it works, thank you!

Hi ! I changed kotlinVersion for 1.7.20 and this is now working !

Current working for react-native-vision-camera@3.6.4 and react-native@0.71.14 :

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 28
        compileSdkVersion = 33
        targetSdkVersion = 33
        supportLibVersion = "28.0.0"
        kotlinVersion = "1.7.20"
        ndkVersion = "23.1.7779620"

its work fine for me, thanks so much @tatiana-lonestone

Hello !

@mrousavy This issue is still coming on V3.6.4 on android

  • React Native => 0.71.14
  • Reanimated => 3.5.4
buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 28
        compileSdkVersion = 33
        targetSdkVersion = 33
        supportLibVersion = "28.0.0"
        kotlinVersion = "1.6.20"
        ndkVersion = "23.1.7779620"

Capture d’écran 2023-10-30 à 17 54 55