GithubHelp home page GithubHelp logo

Comments (29)

DeveloperMCD avatar DeveloperMCD commented on August 16, 2024 7

I'm still getting this error when I add vision-camera-code-scanner to my project, even though 3.0.0-rc5 (with the new react-native-worklets-core) builds fine for Android on my PC.

I'm even using the updated branch (from rkmackinnon), which is supposed to work with Vision Camera v3 (circa March 2023).
I think the recent major changes to v3 are causing a problem. Maybe?

What I'm using right now:
Vision Camera: 3.0.0-rc5
This plugin: https://www.npmjs.com/package/vision-camera-v3-barcode-scanner
React-Native-Worklets-Core: 0.2.0

from vision-camera-code-scanner.

DeveloperMCD avatar DeveloperMCD commented on August 16, 2024 3

https://www.npmjs.com/package/vision-camera-v3-barcode-scanner

The readme is a bit out of date -- I renamed the package to "vision-camera-v3-barcode-scanner" when I published it publicly to NPM.

import {BarcodeFormat, useScanBarcodes, scanBarcodes} from 'vision-camera-v3-barcode-scanner';

from vision-camera-code-scanner.

samcodeng avatar samcodeng commented on August 16, 2024 3

check this out guys, react-native-vision-camera now does QR/Barcode scanning
https://www.react-native-vision-camera.com/docs/guides/code-scanning

from vision-camera-code-scanner.

sekoyo avatar sekoyo commented on August 16, 2024 2
"react-native": "0.72.5",
"react-native-vision-camera": "^3.3.1",
kotlinVersion = "1.7.21"
buildToolsVersion = "33.0.0"
minSdkVersion = 28
compileSdkVersion = 33
targetSdkVersion = 33

Gradle 8.0.1

babelconfig.js (actually think this isn't needed in v3, removing doesn't change error though):

[
  'react-native-reanimated/plugin',
  {
    globals: ['__scanCodes'],
  },
],

For bar codes (not using a package just this lib and works on iOS):

<application ...>
      ...
      <meta-data
          android:name="com.google.mlkit.vision.DEPENDENCIES"
          android:value="barcode" />
</application>

But I still get errors trying to build android (in RN CLI) πŸ€”

<projectPath>/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPluginPackage.java:19: error: cannot find symbol
    FrameProcessorPlugin.register(new VisionCameraCodeScannerPlugin());
                        ^
  symbol:   method register(VisionCameraCodeScannerPlugin)
  location: class FrameProcessorPlugin
<projectPath>/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java:40: error: VisionCameraCodeScannerPlugin is not abstract and does not override abstract method callback(Frame,Map<String,Object>) in FrameProcessorPlugin
public class VisionCameraCodeScannerPlugin extends FrameProcessorPlugin {
       ^
<projectPath>/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java:62: error: method does not override or implement a method from a supertype
  @Override
  ^
<projectPath>/node_modules/vision-camera-code-scanner/android/src/main/java/com/visioncameracodescanner/VisionCameraCodeScannerPlugin.java:251: error: constructor FrameProcessorPlugin in class FrameProcessorPlugin cannot be applied to given types;
    super("scanCodes");
    ^
  required: no arguments
  found: String
  reason: actual and formal argument lists differ in length
4 errors

from vision-camera-code-scanner.

DeveloperMCD avatar DeveloperMCD commented on August 16, 2024 1

Using RKMacKinnon's latest changes, I got everything to build successfully. However, when I try to use the library, I get some new errors now:

ERROR Error: Exception in HostFunction: java.lang.NullPointerException: getPlugin(name, options) must not be null, js engine: hermes
ERROR Error: Exception in HostFunction: java.lang.NullPointerException: getPlugin(name, options) must not be null, js engine: hermes
ERROR TypeError: Cannot read property 'scanBarcodes' of undefined

from vision-camera-code-scanner.

mgcrea avatar mgcrea commented on August 16, 2024 1

@natemartins I had android issues as well in the past but they went away, can you try the latest version v0.5.1 and see if you still encounter issues building vision-camera?

from vision-camera-code-scanner.

manish0707 avatar manish0707 commented on August 16, 2024 1

Updating minSdkVersion to 26 solved this issue for me for now in android.

Looking for a better solution if available.

from vision-camera-code-scanner.

marouane-edghoughi avatar marouane-edghoughi commented on August 16, 2024

Currently facing the same problem, did you manage to solve it?

from vision-camera-code-scanner.

tyanbiao avatar tyanbiao commented on August 16, 2024

Same error 😭

from vision-camera-code-scanner.

joacub avatar joacub commented on August 16, 2024

any advance in this ?

from vision-camera-code-scanner.

marouane-edghoughi avatar marouane-edghoughi commented on August 16, 2024

@DeveloperMCD Unfortunately, we're still facing the same issue even after using your v3 barcode scanner.

from vision-camera-code-scanner.

DeveloperMCD avatar DeveloperMCD commented on August 16, 2024

Yes, as I said in the OP, the updated fork which is supposed to work with the "March 2023 version" of Vision Camera v3 does not currently build. I tried RC3 and the latest RCs as well.

Someone's going to have to dig into the code and update it again, I guess.

Let's be clear; I didn't do any of the coding on this fork. I just grabbed RKMackinnon's fork so I could publish it to a public NPM registry (and thus easily include it in React Native projects).

Now the real hard work begins though -- someone needs to help fix this library (Vision Camera Code Scanner) which is been completely abandoned -- and apparently there are < 1 current contributors to this project: i.e., people who know the code and/or willing to contribute and/or have the skills to bring it up to speed.

from vision-camera-code-scanner.

DeveloperMCD avatar DeveloperMCD commented on August 16, 2024

I'll tell you what though: the MacKinnon fork is certainly the starting point you want to start from. It's the best version or collection of code for "Vision Camera Code Scanner" on the planet right now. It has all the fixes that currently exist somewhere. MacKinnon started out by bringing the whole thing up to speed with V3, albeit the March 2023 version. If you started from the original Vision Camera Code Scanner, you'd have a lot more work to do.

The problem is, there's more fixing to do now. But it's not like those needed fixes can be found completed in some other repository out there. No, that is work yet-to-be-done.

from vision-camera-code-scanner.

mohammadgharouni avatar mohammadgharouni commented on August 16, 2024

any updates?

from vision-camera-code-scanner.

Nanle21 avatar Nanle21 commented on August 16, 2024

I'm still getting this error when I add vision-camera-code-scanner to my project, even though 3.0.0-rc5 (with the new react-native-worklets-core) builds fine for Android on my PC.

I'm even using the updated branch (from rkmackinnon), which is supposed to work with Vision Camera v3 (circa March 2023). I think the recent major changes to v3 are causing a problem. Maybe?

What I'm using right now: Vision Camera: 3.0.0-rc5 This plugin: https://www.npmjs.com/package/vision-camera-v3-barcode-scanner React-Native-Worklets-Core: 0.2.0

This doesn't seem to work also

from vision-camera-code-scanner.

sabarinath-m avatar sabarinath-m commented on August 16, 2024

Facing the same issue here. any solution yet?
My vision Camera version - 3.0.0
I got this issue after upgrading from RN 0.71.10 to RN 0.72.4

from vision-camera-code-scanner.

JackHull avatar JackHull commented on August 16, 2024

Still encountering this error.

from vision-camera-code-scanner.

wangjh7 avatar wangjh7 commented on August 16, 2024

same error

from vision-camera-code-scanner.

wangjh7 avatar wangjh7 commented on August 16, 2024

https://www.npmjs.com/package/vision-camera-v3-barcode-scanner

The readme is a bit out of date -- I renamed the package to "vision-camera-v3-barcode-scanner" when I published it publicly to NPM.

import {BarcodeFormat, useScanBarcodes, scanBarcodes} from 'vision-camera-v3-barcode-scanner';

I tried and it built successfully, Great Job!
I noticed that mrousavy/react-native-vision-camera#1466 (comment), __scanQRCodes(frame) is deprecated in v3, and I assume that the globals: ['__scanCodes'] config can be removed, right?

from vision-camera-code-scanner.

chandubudda avatar chandubudda commented on August 16, 2024

anyone have solution for this error, still facing error

from vision-camera-code-scanner.

chandubudda avatar chandubudda commented on August 16, 2024

VisionCamera: Frame Processors enabled!
CMake Error in CMakeLists.txt:
Imported target "react-native-worklets-core::rnworklets" includes
non-existent path

i am still geting this error while building android

from vision-camera-code-scanner.

chandubudda avatar chandubudda commented on August 16, 2024

https://www.npmjs.com/package/vision-camera-v3-barcode-scanner

The readme is a bit out of date -- I renamed the package to "vision-camera-v3-barcode-scanner" when I published it publicly to NPM.

import {BarcodeFormat, useScanBarcodes, scanBarcodes} from 'vision-camera-v3-barcode-scanner';

VisionCamera: Frame Processors enabled!
CMake Error in CMakeLists.txt:
Imported target "react-native-worklets-core::rnworklets" includes
non-existent path

i am still facing this issue

from vision-camera-code-scanner.

agunbuhori avatar agunbuhori commented on August 16, 2024

same error

from vision-camera-code-scanner.

manish0707 avatar manish0707 commented on August 16, 2024

same error

+1

from vision-camera-code-scanner.

adelindanaila avatar adelindanaila commented on August 16, 2024

+1

from vision-camera-code-scanner.

mgcrea avatar mgcrea commented on August 16, 2024

I've also just released a frame processor rebuilt for vision-camera 3+ that can do high (configurable) fps scanning and provides highlighting of detected barcodes out-of-the-box.

You can check a working demo on GitHub @mgcrea/vision-camera-barcode-scanner.

Hope it can help others.

from vision-camera-code-scanner.

natemartins avatar natemartins commented on August 16, 2024

I've also just released a frame processor rebuilt for vision-camera 3+ that can do high (configurable) fps scanning and provides highlighting of detected barcodes out-of-the-box.

You can check a working demo on GitHub @mgcrea/vision-camera-barcode-scanner.

Hope it can help others.

Does this work on apps that use react-native-reanimated v3 and above? I have been stuck on getting this to work for the past 5 hours but no head way.

This is the error I'm getting

Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'

UPDATE

I removed react-native-reanimated and retried. Same error.

from vision-camera-code-scanner.

natemartins avatar natemartins commented on August 16, 2024

@mgcrea Updating to v0.5.1 fixed it.

Note that you would have to set minSdkVersion to 26 if you're on a version lower than 26. Thanks to @manish0707 for pointing this out

from vision-camera-code-scanner.

sekoyo avatar sekoyo commented on August 16, 2024

Nevermind, somehow vision-camera-code-scanner was still in my yarn.lock, explicitly removing it fixed the error
Screenshot 2023-10-10 at 4 38 43β€―PM

from vision-camera-code-scanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.