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

[BUG 🐛] Could not get unknown property 'kotlinVersion' #90

Closed
longb1997 opened this issue Aug 27, 2024 · 8 comments
Closed

[BUG 🐛] Could not get unknown property 'kotlinVersion' #90

longb1997 opened this issue Aug 27, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@longb1997
Copy link

longb1997 commented Aug 27, 2024

Hello, i just installed this lib and run yarn android, but it's can't build. Only happen on Android

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/mobile/dev/mini-app-checkin/node_modules/react-native-vision-camera-face-detector/android/build.gradle' line: 17

* What went wrong:
A problem occurred evaluating project ':react-native-vision-camera-face-detector'.
> Could not get unknown property 'kotlinVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Device:

  • OS: Android

package.json file:

@longb1997 longb1997 added the bug Something isn't working label Aug 27, 2024
@longb1997
Copy link
Author

holy sh*t, @luicfrr your repo was invaded by bots

@luicfrr
Copy link
Owner

luicfrr commented Sep 6, 2024

Can you please check if this fix this issue?

@michelorth
Copy link

same problem, I try #71 (comment) but not work

@ibrahim-developes
Copy link

Tried on a clean new project this did not came up

@c-goettert
Copy link

I am facing the same issue. The issue is gone after I set a Kotlin-Version in my android/build.gradle, e.g.:

buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 26
        compileSdkVersion = 34
        targetSdkVersion = 34

        kotlinVersion = "2.0.0"
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    ...

However, after I added a Kotin-Version, I am facing issue #71 (exactly the same error). The suggested solution (cleaning gradle cache) does not fix it for me. I tested a lot of kotlinVersions (1.6,1.7,1.9,2.0,...) but none of them did work.. I am working on a bare non-expo RN Project (RN-Version 0.71.19).

@ibrahim-developes
Copy link

image
Kotlin veriosn in node_modules/react-native-vision-camera-face-detector/android/build.gradle' line: 17
should be same as in your project's build.gradle

below is an example

build.gradle of project

ext {
    buildToolsVersion = "34.0.0"
    minSdkVersion = 26
    compileSdkVersion = 34
    targetSdkVersion = 34
    ndkVersion = "25.1.8937393"
    kotlin_version = "1.8.0"
}

node_modules/react-native-vision-camera-face-detector/android/build.gradle' line: 17

def kotlin_version = safeExtGet("VisionCameraFaceDetector_kotlinVersion", "1.8.0")

this should resolve the issue

@c-goettert
Copy link

Thanks for your answer. The kotlinVersion in the file you mentioned was "2.0.0", which I also tried but I still faced the error. I think for me it was also related to the android compileSdkVersion(34). With the help of this comment I found out that I also needed to downgrade vision-camera to version to 4.3.1 for my RN-version (0.71.19). Now it compiles successfully 🎉

@luicfrr
Copy link
Owner

luicfrr commented Oct 7, 2024

I think this issue is solved, right?
I'm closing it now but if the problem still happens maybe we can reopen it.
I'll also add it to Troubleshooting item on readme.

@luicfrr luicfrr closed this as completed Oct 7, 2024
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

No branches or pull requests

7 participants
@c-goettert @michelorth @longb1997 @luicfrr @ibrahim-developes and others