skip to Main Content

I’m getting this error:

> Configure project :react-native-vision-camera
VisionCamera: node_modules/ found at: /home/ed/sc/shuttlecontrol-driver/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 enabled! Building C++ part...
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.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-vision-camera'.
> Failed to notify project evaluation listener.
   > Could not create task ':react-native-vision-camera:compileDebugAndroidTestKotlin'.
      > Cannot use @TaskAction annotation on method AbstractKotlinCompile.execute() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
   > KotlinJvmAndroidCompilation with name 'debugAndroidTest' not found.

after upgrading from 0.70.6 to 0.72.1

I tried rm -r android/build ; rm -r android/app/src/release/res ; rm -r android/app/build/intermediates and ./gradlew clean (in the android folder and it failed too)

After npm run android the build always fails with the above error.

2

Answers


  1. Chosen as BEST ANSWER

    I got passed this problem by adding

    buildscript {
        ext {
            ...
            kotlinVersion = "1.6.21"
            ...
        }
    

    in android/build.gradle.


  2. Your react-native-vision-camera is making an error.

    Go to the documentation of the library and verify the compatibility of the library with the current react-native version. The error message is clearly shown deprecated plugins and obsolete DSL elements causing problems during the project configuration

    Check on the issues and Read documentation to check compatibility.

    1). https://github.com/mrousavy/react-native-vision-camera

    2). https://www.npmjs.com/package/react-native-clarity

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search