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

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

Open
pkowalezyk opened this issue Feb 28, 2022 · 0 comments
Open

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

pkowalezyk opened this issue Feb 28, 2022 · 0 comments

Comments

@pkowalezyk
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant