EddyVerbruggen / nativescript-barcodescanner

🔎 NativeScript QR / barcode (bulk)scanner plugin
MIT License
293 stars 73 forks source link

QR Scanner not working in release mode #241

Closed priyansh360 closed 3 years ago

priyansh360 commented 4 years ago

Hi , Can you please help me out in my issue , I added this plugin to my NS-ng app it is working fine while in development mode but when I generate a signed APK/release in both iOS & Android the plugins doesn't seems to be work. Please reply

Rdevc commented 3 years ago

Hi,

This is probably to late for you but I hope to help others responding on this issue.

After several hours of debugging and trying I figured out the issue and it was possible to debug trough the iOS emulator.

Solution:

@EddyVerbruggen; When hitting the code with beepOnScan: true the following error will occur "AVFAudio`-[AVAudioPlayer initWithContentsOfURL:fileTypeHint:error:]:" with "Thread 1: EXC_BAD_ACCESS (code=1, address=0x18)"

I'm 90% sure one of these lines of code are responsible:

  line 385: var barcodeBundlePath = NSBundle.bundleWithIdentifier("com.telerik.BarcodeScannerFramework").bundlePath;
  line 386 this._player = new AVAudioPlayer({ contentsOfURL: NSURL.fileURLWithPath(barcodeBundlePath + "/beep.caf") });

Kind regards, R

EddyVerbruggen commented 3 years ago

Fixed in the (just published) 4.1.0 version.