Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 of 4 tasks
thuantvDr4 opened this issue Mar 30, 2023 · 19 comments · Fixed by #1466
Closed
3 of 4 tasks
Labels
🐛 bug Something isn't working

Comments

@thuantvDr4
Copy link

thuantvDr4 commented Mar 30, 2023

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

@thuantvDr4 thuantvDr4 added the 🐛 bug Something isn't working label Mar 30, 2023
@Lonoyaa
Copy link

Lonoyaa commented Mar 31, 2023

Hi, have you try running assembleRelease with --info for more detail
I'm just happened to work with the same version of dependencies as you but mine's fine. Did you try adding kotlinVersion and kotlin-gradle-plugin to android/build.gradle? if so, what version is it? mine is 1.6.20

@roberto497
Copy link

Same problem!

@zzz08900
Copy link
Contributor

zzz08900 commented Apr 1, 2023

Probably related gradle/gradle#21116 (comment)
gradle 7.3.3 works all fine here.

@Ho3ein-Boka
Copy link

same problem

@EstebanFuentealba
Copy link

changing kotlin version worked for me

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

@thuantvDr4
Copy link
Author

thanks all !

@diamont1001
Copy link

changing kotlin version worked for me

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

it works, thank you!

@adelbeke
Copy link

adelbeke commented May 5, 2023

Hello, any workaround without downgrading the Kotlin version ?

I really need to use the 1.8.0 version of Kotlin

@matiz87
Copy link

matiz87 commented May 8, 2023

@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.

@myselfuser1
Copy link

@kigh143
Copy link

kigh143 commented Jul 19, 2023

i am getting the same issue with version 0.65 RN

@mrousavy
Copy link
Owner

Hey! I've rewritten the entire Android codebase of VisionCamera from CameraX to Camera2 in the efforts of ✨ VisionCamera V3.

I just now completed the Camera2 rewrite and I believe the core structure is running, but there might be some edge cases to iron out. Can you try and test the PR #1674 for me to see if you can still reproduce this issue here?

Here's an instruction on how you can test that: #1674 (comment)

If the issue cannot be reproduced with that version/PR anymore, then hoorayy, I fixed it! 🎉
Otherwise please let me know and I'll keep this issue open to keep track of it.

Thank you!

@xts-bit
Copy link

xts-bit commented Sep 30, 2023

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

@tatiana-lonestone
Copy link

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

@tatiana-lonestone
Copy link

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"

@ShuraRB
Copy link

ShuraRB commented Nov 9, 2023

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"
        ...
}

@kelrvins
Copy link

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

@robertyulisman
Copy link

robertyulisman commented Dec 12, 2023

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

@zahid502
Copy link

Hi, added some code in node_modules of react-native-vision-camera and it's worked for me.
react-native 0.74.1

path: node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessors/VisionCameraProxy.kt

import com.facebook.react.common.annotations.FrameworkAPI//<--import here... @OptIn(FrameworkAPI::class)//<--insert here

Screenshot 2024-06-10 at 10 19 30 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.