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

🐛 Support for kotlin-android-extensions Gradle plugin version 1.6.20 and higher. #1352

Closed
3 of 4 tasks
maddeye opened this issue Nov 23, 2022 · 34 comments · Fixed by #1466
Closed
3 of 4 tasks

🐛 Support for kotlin-android-extensions Gradle plugin version 1.6.20 and higher. #1352

maddeye opened this issue Nov 23, 2022 · 34 comments · Fixed by #1466
Labels
🐛 bug Something isn't working

Comments

@maddeye
Copy link

maddeye commented Nov 23, 2022

What were you trying to do?

Run my demo application

Reproduceable Code

Use a blank react native init project with gradle 8

What happened instead?

Build Process crashes.

Relevant log output

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher.
The following dependencies do not satisfy the required version:
project ':react-native-vision-camera' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30

Device

Android Simulator

VisionCamera Version

2.15.2

Additional information

@maddeye maddeye added the 🐛 bug Something isn't working label Nov 23, 2022
@finger-guns
Copy link

any updates on this one?

@maddeye
Copy link
Author

maddeye commented Dec 6, 2022

Not really. I found, that Gradle 7.3.3 and Gradle Plugin 7.2.2 is the sweetspot to get everything running and use the current react. You can set this in Android Studio -> Open Module Settings -> Project. Hope this helps!

@sleaper
Copy link

sleaper commented Dec 9, 2022

Having the same error.

@shohelahamad
Copy link

any update on that ? I am having the same error.

@sleaper
Copy link

sleaper commented Dec 12, 2022

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

@bilal-korir
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Thank you @sleaper that solves the issue on my side.

@betanyeli
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Gracias buen hombre 👨‍💻 ! ✨ funcionó perfecto

@GerardoTovar
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Muchas Gracias bro. El problema se resolvió @sleaper

@wmeints
Copy link

wmeints commented Feb 9, 2023

Adding kotlinVersion =1.7.0 to my android/gradle.properties file in my project fixed it for me.

@imran1992
Copy link

Adding kotlinVersion =1.7.0 to my android/gradle.properties file in my project fixed it for me.

By android/gradle.properties do you mean android/build.gradle

@DevineDecrypter
Copy link

issue still persists on react-native@0.71.3

@edritech93
Copy link

still issue on react-native 0.71.7

@mkultr4
Copy link

mkultr4 commented Apr 28, 2023

still issue on react-native@0.71.7

@waleedshkt
Copy link

Follow this instruction, and it's working on RN 0.71.8

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

@jonxssc
Copy link

jonxssc commented May 16, 2023

Bug is still there, i have a temporary fix for everyone who faces this error:
go to react-native-vision-camera in the node-modules folder. There go to android/build.gradle and search for this line org.jetbrains.kotlin:kotlin-gradle-plugin, change it to: org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20 save, then run cd android && ./gradlew clean and then restart your App, works for me, i hope this bug gets fixed soon

@Jhon-Idrovo
Copy link

This is stopping me from using this in production. Please fix it @mrousavy

@sergioprz
Copy link

Has anyone gotten it to work with rn 0.70.8?

@jonxssc
Copy link

jonxssc commented May 22, 2023

Has anyone gotten it to work with rn 0.70.8?

Yes, try my answer two messages above

@batgerelt
Copy link

Bug is still there, i have a temporary fix for everyone who faces this error: go to react-native-vision-camera in the node-modules folder. There go to android/build.gradle and search for this line org.jetbrains.kotlin:kotlin-gradle-plugin, change it to: org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20 save, then run cd android && ./gradlew clean and then restart your App, works for me, i hope this bug gets fixed soon

Worked for me Thank you :-)

@mrousavy
Copy link
Owner

mrousavy commented Jun 1, 2023

That's because RN upgrades (or other libs that use Kotlin) break the version. There's not a lot I can do about this apart from just updating Kotlin version everytime.

@thegreatzeus
Copy link

@mrousavy Please upgrade the version because only you can update the npm package. I would have to manually make changes to the library folder in node_modules every time I want to build locally and if I want to use EAS build I can't even do that.

Please push this change. Thank you!

@bosz
Copy link

bosz commented Jun 9, 2023

ndroid/gradle.properties

Thanks bro, life saver.

@Jhon-Idrovo
Copy link

For those using expo you can install a config plugin:
https://docs.expo.dev/versions/latest/sdk/build-properties/

and in your app.json

"expo":
 "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "kotlinVersion": "1.7.0"
          }
        }
      ]
    ]

@Ali-Kheiri
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

@sleaper
thanks!

@mianaamirshehzad
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Thank you so much for giving the solution. It has reduced my efforts.

@mianaamirshehzad
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Thank you so much for giving the solution. It has reduced my efforts.

My previous error is eliminated but now my screen turns blank when I start the camera. Any fix for it.?

@erikemg
Copy link

erikemg commented Aug 10, 2023

I tried the method you provided but my apk just crashes as soon as I open it. Is there a way to fix this?

@istashak
Copy link

I've literally tried every suggested fix on this thread, and none of them have worked. I can't get past a gradle sync.

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

@ohheyitskartik
Copy link

ohheyitskartik commented Aug 23, 2023

@mrousavy Please upgrade the version because only you can update the npm package. I would have to manually make changes to the library folder in node_modules every time I want to build locally and if I want to use EAS build I can't even do that.

Please push this change. Thank you!

use npm patch-package to patch it on your end with your changes so it applies changes on every npm install until the new version comes out

edit : i checked the files, it picks your kotlin version from your android/build.gradle but only if you have it defined there and the name matches "kotlinVersion" make sure you have it in your ext config and the name matches, i was using "kotlin_version" as kotlin version variable which caused the issue.

@matiasgdev
Copy link

@mrousavy Please upgrade the version because only you can update the npm package. I would have to manually make changes to the library folder in node_modules every time I want to build locally and if I want to use EAS build I can't even do that.
Please push this change. Thank you!

use npm patch-package to patch it on your end with your changes so it applies changes on every npm install until the new version comes out

edit : i checked the files, it picks your kotlin version from your android/build.gradle but only if you have it defined there and the name matches "kotlinVersion" make sure you have it in your ext config and the name matches, i was using "kotlin_version" as kotlin version variable which caused the issue.

This is the true answer, thank you so much!

@Hakimji-Mustafa
Copy link

Adding kotlinVersion =1.7.0 to my android/gradle.properties file in my project fixed it for me.

@akash510
Copy link

Hi, i already change the kotlin version to 1.7.0 FAILURE: Build failed with an exception. But, still showing same error. Please help.
Error

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ':wakelock' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

my code:
buildscript {
ext.kotlin_version = '1.7.0'
repositories {
google()
mavenCentral()

}

dependencies {
    classpath 'com.android.tools.build:gradle:7.3.0'
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0'
    classpath 'com.google.gms:google-services:4.3.15'
}

@mahammad72
Copy link

any update on that ? I am having the same error.

I added kotlinVersion = "1.7.0" (under buildToolsVersion) to android/build.gradle and error disappeared.

Thanks man you save my time

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.