NativeScript / mlkit

Apache License 2.0
24 stars 9 forks source link

Android - issue w/ setProcessEveryNthFrame #33

Closed DanielDent closed 1 year ago

DanielDent commented 1 year ago

I have an application which works fine on iOS, but crashes on Android. I get the following error:

JS: [Vue warn]: Error in nextTick: "TypeError: __classPrivateFieldGet(...).setProcessEveryNthFrame is not a function"

Was Android tested when support for setProcessEveryNthFrame was added?

DanielDent commented 1 year ago

I have further details about this crash: it seems to occur specifically when processEveryNthFrame gets attached to a variable, and that variable is changed. I.e. in Vue, :processEveryNthFrame="testVariable", and then testVariable is mutated.

DanielDent commented 1 year ago

I am mistaken about my prior comment, this crash seems to still occur even if testVariable is not mutated.

DanielDent commented 1 year ago

For what it's worth, when I tried removing setProcessEveryNthFrame from the app entirely, the build ran on Android, but did not detect any barcodes. The exact same codebase on iOS works great.

brooklax commented 1 year ago

@DanielDent were you able to find a workaround or resolve the issue? it seems that adding the "setProcessEveryNthFrame" prop improves barcode scanner accuracy but it's still resulting in a crash when the prop is added on android.

We're using:

"@nativescript/mlkit-barcode-scanning": "^1.0.6", "@nativescript/mlkit-core": "^1.0.6", "@nativescript/android": "8.4.0", "@nativescript/ios": "8.4.0", "nativescript-vue": "^2.9.3",

devlinpadayachee commented 1 year ago

Anybody found a workaround?

triniwiz commented 1 year ago

Finally got change to fix this so it now works in the latest release, thanks for reporting.

brooklax commented 1 year ago

@triniwiz apologies but I just tested with a new android build on my side and although I don't get an exception anymore like before, it also seems like adding the property now results in no results returned for the detection event. When I remove the property scanning works but it's not accurate with Code39 barcode types especially.

<MLKitView cameraPosition="back" :detectionType="type || 'all'" :barcodeFormats="formats" :processEveryNthFrame="60" @detection="onScanResult" :pause="pauseScanner" :torchOn="torchOn" />

brooklax commented 1 year ago

Sorry I see this issue is closed, will open a new one

devlinpadayachee commented 1 year ago

@triniwiz apologies but I just tested with a new android build on my side and although I don't get an exception anymore like before, it also seems like adding the property now results in no results returned for the detection event. When I remove the property scanning works but it's not accurate with Code39 barcode types especially.

<MLKitView cameraPosition="back" :detectionType="type || 'all'" :barcodeFormats="formats" :processEveryNthFrame="60" @detection="onScanResult" :pause="pauseScanner" :torchOn="torchOn" />

+1

devlinpadayachee commented 1 year ago

Any updates?

triniwiz commented 1 year ago

Nothing yet, but I'll look into it soon