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

🔧 error: package com.mrousavy.camera.frameprocessor does not exist #3368

Open
3 of 5 tasks
sumreenali-servionsoft opened this issue Jan 16, 2025 · 2 comments
Open
3 of 5 tasks
Labels
🔧 build error Issue is related to building VisionCamera in your project

Comments

@sumreenali-servionsoft
Copy link

sumreenali-servionsoft commented Jan 16, 2025

How were you trying to build the app?

"react-native-vision-camera": "^4.6.3",
"react-native-worklets-core": "^1.5.0",
"vision-camera-face-detector": "^0.1.8"

i have installed these packages through npm install
tried following solutions

  1. clean project through npx react-native-clean-project

  2. running these commands
    brew uninstall --cask zulu11
    brew install --cask adoptopenjdk/openjdk/adoptopenjdk11

  3. cleaning gradlew and build watchman

  4. restarting metro bundler

  5. i tried adding these dependencies in build.gradle
    implementation 'com.google.mlkit:face-detection:16.1.5'

    // ML Kit Vision Dependencies
    implementation 'com.google.mlkit:vision-common:17.3.0'

    // Worklets Core (if not already installed)
    implementation project(':react-native-worklets-core')

    // CameraX (used by react-native-vision-camera)
    implementation "androidx.camera:camera-core:1.1.0"
    implementation "androidx.camera:camera-camera2:1.1.0"
    implementation "androidx.camera:camera-lifecycle:1.1.0"
    implementation "androidx.camera:camera-view:1.1.0"

and in settings.gradle
include ':react-native-vision-camera'
project(':react-native-vision-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vision-camera/android')

my babel.config.js file

module.exports = function(api) {
if (api.env("production")) {
return {
"presets": ["module:@react-native/babel-preset"],
"plugins": [
// "transform-flow-strip-types",
"transform-remove-console",
"react-native-reanimated/plugin"
]
}
}

return {
"presets": ["module:@react-native/babel-preset"],
"plugins": [
// "transform-flow-strip-types",
"react-native-reanimated/plugin"
]
}
};

this is my android/build.gradle file

buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"

    googlePlayServicesAuthVersion = "20.7.0"
    googlePlayServicesVersion      = "17.0.0"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
    classpath ("com.google.gms:google-services:4.4.2")
    
}

}

apply plugin: "com.facebook.react.rootproject"

i tried all these solutions and configuration but still i'm getting this error

Full build logs

Task :vision-camera-face-detector:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
596 actionable tasks: 16 executed, 580 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:29: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin;
                                         ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:35: error: cannot find symbol
public class VisionCameraFaceDetectorPlugin extends FrameProcessorPlugin {
                                                    ^
  symbol: class FrameProcessorPlugin
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:10: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin;
                                         ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:134: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:141: error: cannot access Detector
      Task<List<Face>> task = faceDetector.process(image);
                                          ^
  class file for com.google.mlkit.vision.common.internal.Detector not found
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:19: error: cannot find symbol
    FrameProcessorPlugin.register(new VisionCameraFaceDetectorPlugin());
    ^
  symbol:   variable FrameProcessorPlugin
  location: class VisionCameraFaceDetectorPluginPackage
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':vision-camera-face-detector:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 6s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:29: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin; ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:35: error: cannot find symbol
public class VisionCameraFaceDetectorPlugin extends FrameProcessorPlugin { ^ symbol: class FrameProcessorPlugin
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:10: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin; ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:134: error: method does not override or implement a method from a supertype @Override ^
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:141: error: cannot access Detector Task<List<Face>> task = faceDetector.process(image); ^ class file for com.google.mlkit.vision.common.internal.Detector not found
/Users/g/Desktop/nextfriend/frontend/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:19: error: cannot find symbol FrameProcessorPlugin.register(new VisionCameraFaceDetectorPlugin()); ^ symbol: variable FrameProcessorPlugin location: class VisionCameraFaceDetectorPluginPackage
6 errors FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':vision-camera-face-detector:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details. * Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights. BUILD FAILED in 6s.
info Run CLI with --verbose flag for more details.

Project dependencies

"react-native-vision-camera": "^4.6.3",
 "react-native-worklets-core": "^1.5.0",
 "vision-camera-face-detector": "^0.1.8"

VisionCamera Version

4.6.3

Target platforms

iOS, Android

Operating system

MacOS

Can you build the VisionCamera Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

@sumreenali-servionsoft sumreenali-servionsoft added the 🔧 build error Issue is related to building VisionCamera in your project label Jan 16, 2025
@maintenance-hans maintenance-hans bot changed the title error: package com.mrousavy.camera.frameprocessor does not exist 🔧 error: package com.mrousavy.camera.frameprocessor does not exist Jan 16, 2025
Copy link

maintenance-hans bot commented Jan 16, 2025

Guten Tag, Hans here! 🍻

It looks like you're experiencing a build error related to a missing package. From ze logs you've provided, it seems like "react-native-worklets-core" might not be correctly linked, or perhaps it's not installed properly. I recommend checking if you've correctly set up and linked all required dependencies.

Also, make sure to build ze VisionCamera example app, as it can help identify if the issue is with your setup or something specific to your project.

Keep in mind that if you're looking for quicker support, consider supporting this project by becoming a sponsor here.

Please let us know what you find!

Note: If you think I made a mistake, please ping @mrousavy to take a look.

@sumreenali-servionsoft
Copy link
Author

vision camera works fine but when I installed vision-camera-face-detection and react-native-worklets-core it started giving me above errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 build error Issue is related to building VisionCamera in your project
Projects
None yet
Development

No branches or pull requests

1 participant