NativeScript / mlkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Seeing bugs with angular property bindings

cjohn001 opened this issue · comments

@triniwiz
I played around a little with the new plugin. Unfortunately, I cannot get things working. I prepared a demo showing some of the issues I run into. You can find it here:

https://github.com/cjohn001/mlkit-test

The demo shows 2 different issues. I assume both has to do with the angular bindings which seem to not work as expected.

  1. Issue on IOS: The app runs and shows video, but it does not detect any barcodes. When debugging, I see that _onScanCallback(result) is called and holds a barcode. I see that the source of the problem is given in the following line:

if (this.detectionType === DetectionType.None || !this.onDetection) {

At that point this.detectionType and this.onDetection both have a value of undefined. I set both in the Angular bindings as you can see in the demo. I have not been able to figure out what is wrong with the attribute bindings, would be great if you could have a look into it.

  1. Issue on Android: When I try to run the demo app on Android, it directly crashes. Seems like the BarcodeFormat has an issue on Android.

System.err: Calling js method onCreateView failed
System.err: Error: com.tns.system.classes.loading.LookedUpClassNotFound: Class "io.github.triniwiz.fancycamera.barcodescanning.BarcodeScanner.BarcodeFormat" not found.
System.err:
System.err: StackTrace:
System.err: [barcodeFormats:setNative](file: src/webpack:/mlkit-test/node_modules/@nativescript/mlkit-core/index.android.js:233:0)
System.err: at applyAllNativeSetters(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/properties/index.js:1136:0)
System.err: at initNativeView(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/properties/index.js:1079:0)
System.err: at onResumeNativeUpdates(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/view-base/index.js:737:22)
System.err: at _resumeNativeUpdates(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/view-base/index.js:280:0)
System.err: at onLoaded(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/view-base/index.js:235:0)
System.err: at onLoaded(file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/view/index.android.js:309:0)
System.err: at onLoaded(file: src/webpack:/mlkit-test/node_modules/@nativescript/mlkit-core/index.android.js:335:0)
System.err: at (file: src/webpack:/mlkit-test/node_modules/@nativescript/core/ui/core/view-base/index.js:318:0)

The demo only has the base template

@triniwiz: I am sorry, I do not understand. What do you mean with base template? I were speaking about the demo I wrote under the given link

https://github.com/cjohn001/mlkit-test

There is new code to check in the repo

@triniwiz : I am sorry, I had forgotten to commit the latest changes. Now its there.
You are meaning I should not use
"@nativescript/mlkit-barcode-scanning": "^1.0.0-alpha.0",
"@nativescript/mlkit-core": "^1.0.0-alpha.0",

as there is new code in this repository? Hence, I should build the plugins myself to get the latest?