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

🐛 Unable to start the react-native app after installing react-native-vision-camera. #1521

Closed
3 of 4 tasks
Szabolcs11 opened this issue Mar 11, 2023 · 5 comments
Closed
3 of 4 tasks
Labels
🐛 bug Something isn't working

Comments

@Szabolcs11
Copy link

What were you trying to do?

I simply create a react native app. And after that I install the react-native-vision-camera, and I unable to start the project.

Reproduceable Code

npx react-native@latest init AwesomeProject
npm i react-native-vision-camera
cd AwersomeProject
npm run start
npm run android

What happened instead?

I got an error.
When I got to ./android and try to run ./gradlew clean I got the same issue.

Relevant log output

PS C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp> npm run android

> tsisappp@0.0.1 android  
> react-native run-android

info Starting JS server...
info Installing the app...

> Configure project :react-native-vision-camera
VisionCamera: node_modules/ found at: C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp\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.
5 actionable tasks: 5 up-to-date

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

* Try:
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

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.bat app:installDebug -PreactNativeDevServerPort=8081

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

* 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 8s

    at makeError (C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\Szabolcs\Desktop\Szaby\Projects\TSISApp2\tsisappp\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

Device

Huawei Honor 9X Android

VisionCamera Version

"react-native-vision-camera": "^2.15.4"

Additional information

@Szabolcs11 Szabolcs11 added the 🐛 bug Something isn't working label Mar 11, 2023
@javier-sauma-rocketlab
Copy link

javier-sauma-rocketlab commented Mar 14, 2023

same over here
EDIT: this bug is solved in the next link
#1352

Resume:

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

@tsanyqudsi
Copy link

to add from @javier-sauma-rocketlab 's answer.

If you're using expo, install expo-build-properties ( https://docs.expo.dev/versions/latest/sdk/build-properties/ ) to change kotlin version

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

@andriyfm
Copy link

Same issue

@myselfuser1
Copy link

@Szabolcs11 Szabolcs11 reopened this Jul 4, 2023
@Szabolcs11
Copy link
Author

I just added kotlinVersion = "1.7.0" to android/build.gradle and now it's working.

@mrousavy
Copy link
Owner

Closing as this is a stale issue - this might have been fixed with the full rewrite in VisionCamera V3 (🥳) - if not, please create a new issue.

If your issue has been fixed, consider sponsoring me on GitHub to say thanks 💖

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
@tsanyqudsi @mrousavy @andriyfm @Szabolcs11 @javier-sauma-rocketlab @myselfuser1 and others