tony-xlh / vision-camera-dynamsoft-barcode-reader

React Native Vision Camera Frame Processor Plugin of Dynamsoft Barcode Reader
MIT License
76 stars 16 forks source link

FrameProcessorPlugin cannot be applied to given types; super("decode"); #14

Closed DeveloperMCD closed 11 months ago

DeveloperMCD commented 1 year ago

I am trying to use this library in a new React Native 0.72.4 app. Here are the details of my setup, build environment, etc.: https://gradle.com/s/jw23c563san6w

I'm getting an error during the build process:

/home/matthew/dev/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDynamsoftBarcodeReaderPackage.java:23: error: cannot find symbol FrameProcessorPlugin.register(plugin); ^ symbol: method register(VisionCameraDBRPlugin) location: class FrameProcessorPlugin /home/matthew/dev/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:28: error: VisionCameraDBRPlugin is not abstract and does not override abstract method callback(Frame,ReadableNativeMap) in FrameProcessorPlugin public class VisionCameraDBRPlugin extends FrameProcessorPlugin { ^ /home/matthew/dev/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:33: error: method does not override or implement a method from a supertype @Override ^ /home/matthew/dev/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:160: error: constructor FrameProcessorPlugin in class FrameProcessorPlugin cannot be applied to given types; super("decode"); ^ required: no arguments found: String reason: actual and formal argument lists differ in length 4 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

xulihang commented 1 year ago

Which version of vision camera are you using?

I haven't tested it on the latest react native. Someone lists the package versions combination that works: https://github.com/mrousavy/react-native-vision-camera/issues/1662

DeveloperMCD commented 1 year ago

Now the errors are slightly different; still not working however.

/home/matthew/dev/rn/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:28: error: VisionCameraDBRPlugin is not abstract and does not override abstract method callback(Frame,ReadableNativeMap) in FrameProcessorPlugin public class VisionCameraDBRPlugin extends FrameProcessorPlugin { ^ /home/matthew/dev/rn/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:33: error: method does not override or implement a method from a supertype @Override ^ /home/matthew/dev/rn/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDBRPlugin.java:160: error: constructor FrameProcessorPlugin in class FrameProcessorPlugin cannot be applied to given types; super("decode"); ^ required: no arguments found: String reason: actual and formal argument lists differ in length /home/matthew/dev/rn/stackbayapp/node_modules/vision-camera-dynamsoft-barcode-reader/android/src/main/java/com/visioncameradynamsoftbarcodereader/VisionCameraDynamsoftBarcodeReaderPackage.java:23: error: cannot find symbol FrameProcessorPlugin.register(plugin); ^ symbol: method register(VisionCameraDBRPlugin) location: class FrameProcessorPlugin 4 errors

FAILURE: Build failed with an exception.

React Native 0.72.4

tony-xlh commented 1 year ago

This is more related to https://github.com/mrousavy/react-native-vision-camera. You can post an issue there.

xulihang commented 1 year ago

Updating vision camera to 2.16.1 and react-native-reanimated to 3.5.4 should solve this problem with react native 0.72+