rodgomesc / vision-camera-face-detector

VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
MIT License
89 stars 65 forks source link

VisionCameraFaceDetectorPlugin is not abstract #48

Open geoff8888 opened 8 months ago

geoff8888 commented 8 months ago

Tried installing it and getting this error during compile.


/VisionCameraFaceDetectorPlugin.java:35: error: VisionCameraFaceDetectorPlugin is not abstract and does not override abstract method callback(Frame,Map<String,Object>) in FrameProcessorPlugin
public class VisionCameraFaceDetectorPlugin extends FrameProcessorPlugin {

```       ^
vanditmehta commented 8 months ago

getting same issue

SarhaneGhribi commented 8 months ago

i am getting the same error too

edwardhsueh commented 7 months ago

I am getting the same issue too

sofly commented 7 months ago

I am getting the same issue too

xunpengliu commented 6 months ago

Hi everyone, I check the code of android and I found VisionCameraFaceDetectorPlugin.java is implement FrameProcessorPlugin. The FrameProcessorPlugin originate form project react-native-vision-camera and be modify in version 3.0.0. The version 3.0.0 or late or react-native-vision-camera is not compatible with the current project.

VisionCameraFaceDetectorPlugin public Object callback(ImageProxy frame, Object[] params)

FrameProcessorPlugin.java 3.0.0 or later public abstract @Nullable Object callback(@NonNull Frame frame, @Nullable Map<String, Object> params);

So I think we need use old react-native-vision-camera version. I found 2.16.5 is compatible with the current project and I using old version build success. The version as below:

"react-native": "0.72.7",
"react-native-vision-camera": "2.16.5",
"vision-camera-face-detector": "0.1.8"

And my gradle version is gradle-7.5.1-bin.zip. If i use gradle 8.0+ and react-native 0.73+, I will encounter another compilation error.

Here is my full package.json file

{
  "name": "faceRecognition",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "react": "18.2.0",
    "react-native": "0.72.7",
    "react-native-reanimated": "3.5.2",
    "react-native-vision-camera": "2.16.5",
    "vision-camera-face-detector": "0.1.8"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native/eslint-config": "^0.72.2",
    "@react-native/metro-config": "^0.72.11",
    "@tsconfig/react-native": "^3.0.0",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.76.8",
    "prettier": "^2.4.1",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "engines": {
    "node": ">=16"
  }
}