Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Class constructor ContentView cannot be invoked without 'new' #1872

@pkowalezyk

Description

@pkowalezyk

Hello,

I'm trying to integrade MLKitBarcodeScanner to my NativeScript 8.0.1 app with Vue.Js.

I added this to my main.js :

Vue.registerElement(
  'MLKitBarcodeScanner', () => require("nativescript-plugin-firebase/mlkit/barcodescanning").MLKitBarcodeScanner
);

And this to my app component :

<MLKitBarcodeScanner
    width="260"
    height="380"
    beepOnScan="true"
    formats="QR_CODE"
    preferFrontCamera="false"
    supportInverseBarcodes="false"
    @scanResult="onScanResult">
</MLKitBarcodeScanner>

However, I got the following errors while running with Android emulator :

chromium: [ERROR:web_contents_delegate.cc(218)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.

While I added these lines to my AndroidManifest.xml as required :

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

I also receive the following error :

TypeError: Class constructor ContentView cannot be invoked without 'new'

Am I missing something ?

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions