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

The Android Gradle plugin supports only kotlin-android-extensions Gradle plugin version 1.6.20 and higher. #1477

Closed
3 of 4 tasks
gokhancivili opened this issue Feb 16, 2023 · 8 comments · Fixed by #1466
Closed
3 of 4 tasks
Labels
🐛 bug Something isn't working

Comments

@gokhancivili
Copy link

What were you trying to do?

I'm trying to make a barcode reader

Reproduceable Code

Use a blank react native project

What happened instead?

Build Process crashes.

Relevant log output

> Configure project :react-native-vision-camera
VisionCamera: node_modules/ found at: C:\ReactNative\test\node_modules
VisionCamera: Building with Hermes...
Warning: The 'kotlin-android-extensions' Gradle plugin is deprecated. Please use this migration guide (https://goo.gle/kotlin-android-extensions-deprecation) to start working with View Binding (https://developer.android.com/topic/libraries/view-binding) and the 'kotlin-parcelize' plugin.
VisionCamera: Frame Processors are disabled because REA v2 does not exist. C++ part will not be built.
WARNING:DSL element 'dexOptions' is obsolete and should be removed.
It will be removed in version 8.0 of the Android Gradle plugin.
Using it has no effect, and the AndroidGradle plugin optimizes dexing automatically.

* 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.4

Additional information

@gokhancivili gokhancivili added the 🐛 bug Something isn't working label Feb 16, 2023
@ozgurbayram
Copy link

ozgurbayram commented Feb 16, 2023

You should define kotlin version in your android/build.gradle file to kotlinVersion = "1.6.20"

@zzz08900
Copy link
Contributor

zzz08900 commented Feb 17, 2023

You should define kotlin version in your android/build.gradle file to kotlinVersion = "1.6.20"

That does solve the problem but I guess there should be some regression test and nobody is feeling like doing it(myself included)
I haven't heard/experienced any issue using 1.6.20 + vision camera for a while but I would rather believe I'm just being lucky.

FYI vision camera 3.0 RC1 is out and kotlin version was bumped to 1.7.20 so with any luck we can skip all the regression stuff and jump into version camera 3.0

@khadeshyam
Copy link

To solve this issue, you can try upgrading the Kotlin Gradle plugin version in the react-native-vision-camera project to version 1.6.20 or higher, which is supported by the Android Gradle plugin version you are using.

Go to node_modules/react-native-vision-camera/android/build.gradle

inside dependencies

dependencies {
           ....
           - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
           + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"
           ....
  } 

remove classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

add classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20"

@TomWq
Copy link

TomWq commented Mar 14, 2023

When is it going to be fixed? You have to change it manually every time

@ospfranco
Copy link

You don't need to manually patch the version in node_modules, you can add the following attribute in the root build.gradle:

CleanShot 2023-03-15 at 08 26 39

@mj-jadhav
Copy link

@gokhancivili react-native-vision-camera has defined the dependency of org.jetbrains.kotlin:kotlin-gradle-plugin to version 1.5.30 but you can override this by adding the following in your android/gradle.properties:

kotlinVersion=1.6.20

I faced the same issue but the above change fixed it for me.

@KeunwooPark
Copy link

KeunwooPark commented May 12, 2023

I'm also facing the same problem, but I am sure it is fine to modify files in native projects. They will be generated from app.json So any direct modifications might cause problems. Are there any other solutions for this issue? I tried modifying build properties for android.kotlinVersion, but Expo did not correctly generate native project files and having the same error.

@myselfuser1
Copy link

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

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.

11 participants