phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.42k forks source link

Plugin fails to declare ZXing activity #860

Closed adrianjarc closed 4 years ago

adrianjarc commented 4 years ago

Expected Behaviour

When I try to scan barcode it opens camera, and scans.

Actual Behaviour

When I try to scan barcode the application crashes.

Steps to Reproduce

  1. Add platform android
  2. install application
  3. Try to scan barcode.

Important to add: This does not always happen. It happens after some builds. But if I try to declare activity by hand my builds fail most of the time.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android 9

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

Xiaomi MI A2

Cordova CLI version and cordova platform version

Cordova: 9.0.0 (cordova-lib@9.0.1) cordova-android: 8.1.0

Plugin version

8.1.0

Logs taken while reproducing problem

Fatal Exception: android.content.ActivityNotFoundException: Unable to find explicit activity class {application/com.google.zxing.client.android.CaptureActivity}; have you declared this activity in your AndroidManifest.xml?
       at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2012)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1675)
       at android.app.Activity.startActivityForResult(Activity.java:4586)
       at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:345)
       at android.app.Activity.startActivityForResult(Activity.java:4544)
       at org.apache.cordova.CordovaInterfaceImpl.startActivityForResult(CordovaInterfaceImpl.java:68)
       at com.phonegap.plugins.barcodescanner.BarcodeScanner$1.run(BarcodeScanner.java:204)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:764)
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.