mono0926/barcode_scan2

[Bug] App crashing when instructing to scan

bnayagrawal opened this issue · 1 comments

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug
Unable to scan for QR code. As soon as I click on the scan button, the app crashes. Crashing on Android. Don't know about IOS.

To Reproduce
Steps to reproduce the behavior:
Source code snippet:

  _scanQrCode() async {
    final ScanResult scanResult = await BarcodeScanner.scan();
    if(scanResult.type == ResultType.Barcode && scanResult.format == BarcodeFormat.qr) {
      _configureQRData(scanResult.rawContent.trim());
    } else {
      _showToast(locale.msgQrFail);
    }
  }

Expected behavior
On click scan, the scanning screen should be shown for scanning QR code.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
D/AndroidRuntime(14501): Shutting down VM
E/AndroidRuntime(14501): FATAL EXCEPTION: main
E/AndroidRuntime(14501): Process: in.corp.myapp.debug, PID: 14501
E/AndroidRuntime(14501): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/zxing/BarcodeFormat;
E/AndroidRuntime(14501): at de.mintware.barcode_scan.BarcodeScannerActivity.(BarcodeScannerActivity.kt:33)
E/AndroidRuntime(14501): at java.lang.Class.newInstance(Native Method)
E/AndroidRuntime(14501): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
E/AndroidRuntime(14501): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
E/AndroidRuntime(14501): at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
E/AndroidRuntime(14501): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3520)
E/AndroidRuntime(14501): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3780)
E/AndroidRuntime(14501): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/AndroidRuntime(14501): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(14501): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(14501): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2251)
E/AndroidRuntime(14501): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14501): at android.os.Looper.loop(Looper.java:233)
E/AndroidRuntime(14501): at android.app.ActivityThread.main(ActivityThread.java:8035)
E/AndroidRuntime(14501): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14501): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/AndroidRuntime(14501): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
E/AndroidRuntime(14501): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.zxing.BarcodeFormat" on path: DexPathList[[zip file "/data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/base.apk"],nativeLibraryDirectories=[/data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/lib/arm64, /data/app/~~dczBNEhshJBc0efpkRNGYA==/in.corp.myapp.debug-_RR2_ZvqM6LXbr6gl51a9Q==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(14501): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
E/AndroidRuntime(14501): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(14501): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

Environment (please complete the following information):

  • iOS? Version: N/A
  • Android? Version: 11
  • Real Device? Which?: OnePlus 9 Pro
  • Emulator/Simulator? Which?: N/A
  • Version of barcode_scan: 4.2.0
  • Output of flutter --version:
Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (3 weeks ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2

Additional context
No more info. available.

Still happen on flutter 3.X.X ?