Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration error #262

Open
tostamista23 opened this issue Apr 14, 2021 · 9 comments
Open

Configuration error #262

tostamista23 opened this issue Apr 14, 2021 · 9 comments

Comments

@tostamista23
Copy link

tostamista23 commented Apr 14, 2021

Hi, when i try to open the scanner i get "Configuration error"

Phone: Xiaomi 9S
Android: 11

Both available() and hasCameraPermission() return true

Permissions:

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

tns platform remove android then tns platform add android didnt help

Package.json

"@angular/animations": "~11.0.0",
"@angular/common": "~11.0.0",
"@angular/compiler": "~11.0.0",
"@angular/core": "~11.0.0",
"@angular/forms": "~11.0.0",
"@angular/platform-browser": "~11.0.0",
"@angular/platform-browser-dynamic": "~11.0.0",
"@angular/router": "~11.0.0",
"@aspnet/signalr": "^1.0.27",
"@nativescript/angular": "~11.0.0",
"@nativescript/core": "~7.1.3",
"@nativescript/theme": "~3.0.0",
"@nstudio/nativescript-checkbox": "^2.0.4",
"@triniwiz/nativescript-toasty": "^4.1.1",
"core-js": "^3.8.0",
"nativescript-barcodescanner": "^4.1.0",
"nativescript-theme-core": "^2.0.24",
"nativescript-ui-listview": "^9.1.0",
"nativescript-ui-sidedrawer": "^9.0.3",
"nativescript-websockets": "^1.5.6",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.6.0",
"tslib": "~2.0.0",
"zone.js": "~0.11.1"
doScanWithBackCamera() {
    this.scan(false, true);
}

private scan(front: boolean, flip: boolean, torch?: boolean) {
    new BarcodeScanner().scan({
      formats: "QR_CODE,PDF_417",   // Pass in of you want to restrict scanning to certain types
      cancelLabel: "EXIT. Also, try the volume buttons!", // iOS only, default 'Close'
      cancelLabelBackgroundColor: "#333333", // iOS only, default '#000000' (black)
      message: "Use the volume buttons for extra light", 
      showFlipCameraButton: true,  
      preferFrontCamera: false,     
      showTorchButton: true,      
      beepOnScan: true,            
      fullScreen: true,  
      torchOn: false,
      closeCallback: function() { console.log("Scanner closed"); }, 
      resultDisplayDuration: 500, 
      orientation: "landscape",  
      openSettingsIfPermissionWasPreviouslyDenied: true previously denied
    }).then(
      function(result) {
        console.log("Scan format: " + result.format);
        console.log("Scan text:   " + result.text);
      },
      function(error) {
        console.log("No scan: " + error);
      }
    );
  }
  

HTML

<Button class="btn btn-primary btn-rounded-sm" text="OPEN" (tap)="doScanWithBackCamera()"></Button>

Thanks for any help

EDIT 1: Its seems intent.resolveActivity returns null even after removing and adding platform

@ikiK-CRO
Copy link

I have been at this for two strait days also. NS8 Core, all cheeks on permissions granted and what ever i try i get:

JS: Camera permission was already granted
JS: No scan: Configuration error

Also, granted in manifest, also made tns clean even.
Its funny tho that I event pulled demo app from git and that is working on my device. I have been over all possible articles and compering demo with my app I see no reasons not to work.

@chimmelb
Copy link

Same. Updated to NS8 today and started receiving this same error "Configuration Error". There is only one reference in the code. Some setup/gradle issues related to intent.resolveActivity(Utils.ad.getApplicationContext().getPackageManager()) !== null?

@tostamista23
Copy link
Author

tostamista23 commented Apr 15, 2021

Going back to [email protected] fix the problem for me, maybe 4.1.0 only supports ns8+?
After downgrading, if you are getting Cannot read property 'client' of undefined make sure to delete and add platform
tns platform remove android
then
tns platform add android

@ikiK-CRO
Copy link

I could kiss you right now. Just downgrade to 4.0.1 fixed the issue.

Thanks, I was stuck at this for days.

@EddyVerbruggen
Copy link
Owner

Interesting, thanks for the report!

I think the 4.1 version was only tested on iOS (because that's the only platform the app I'm using this plugin for is targeting). I'll take a look soon.

@LaKing
Copy link

LaKing commented Apr 20, 2021

Bumped into this too ....

@ikiK-CRO
Copy link

Yeah I just got iPhone to test the app, it does not work on iPhone. But works on android when reverted back. Only way to use my app is thru registration by scanning the barcode from my desktop app. So this would be HUGE help if this bug could be fixed.

@EddyVerbruggen
Copy link
Owner

Seems like the publish-script fired back at me. I've just published 4.1.1 which should fix the issue for both iOS and Android. Thanks for your patience!

@chimmelb
Copy link

This worked for me. Thank you!
npm install [email protected] --save
ns platform remove android
ns run android

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

No branches or pull requests

5 participants