NativeScript/mlkit

Android - issue w/ setProcessEveryNthFrame

DanielDent opened this issue ยท 11 comments

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?

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.

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

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.

@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",

Anybody found a workaround?

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

@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"
/>

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

@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

Any updates?

Nothing yet, but I'll look into it soon