Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

App crashes just after camera preview is shown (Android 6) #609

Open
Giriton opened this issue Feb 13, 2018 · 11 comments
Open

App crashes just after camera preview is shown (Android 6) #609

Giriton opened this issue Feb 13, 2018 · 11 comments

Comments

@Giriton
Copy link

Giriton commented Feb 13, 2018

Expected Behaviour

Camera preview opens, i see myself (in front camera) until I use a QR code.

Actual Behaviour

Camera preview opens, i see myself (in front camera) for 0.5 second, the whole app crashes.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

  • It happens every time I run this plugin. With default configuration and also with configuration:
    formats: "QR_CODE"

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

Android 6.0

Cordova CLI version and cordova platform version

cordova --version : 7.1.0
cordova platforms : android 6.3.0

Plugin version

cordova plugin version | grep phonegap-plugin-barcodescanner : 7.0.2

Logs taken while reproducing problem

(full logcat with other info about camera and formats selected are in attached here
errorLog.txt
)

FATAL EXCEPTION: Thread-496
Process: com.our.packagename.ui, PID: 8391
java.lang.ArrayIndexOutOfBoundsException: src.length=460800 srcPos=461160 dst.length=810000 dstPos=46800 length=1200
	at java.lang.System.arraycopy(Native Method)
	at com.google.zxing.PlanarYUVLuminanceSource.getMatrix(PlanarYUVLuminanceSource.java:101)
	at com.google.zxing.common.HybridBinarizer.getBlackMatrix(HybridBinarizer.java:70)
	at com.google.zxing.BinaryBitmap.getBlackMatrix(BinaryBitmap.java:85)
	at com.google.zxing.qrcode.QRCodeReader.decode(QRCodeReader.java:77)
	at com.google.zxing.MultiFormatReader.decodeInternal(MultiFormatReader.java:171)
	at com.google.zxing.MultiFormatReader.decodeWithState(MultiFormatReader.java:85)
	at com.google.zxing.client.android.DecodeHandler.decode(DecodeHandler.java:96)
	at com.google.zxing.client.android.DecodeHandler.handleMessage(DecodeHandler.java:60)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:148)
	at com.google.zxing.client.android.DecodeThread.run(DecodeThread.java:110)
@macdonst
Copy link
Member

@Giriton yeah, that crash is coming from deep inside the ZXing library the plugin uses for decoding barcodes.

@Giriton
Copy link
Author

Giriton commented Feb 21, 2018

@macdonst I see, thank you for clarification. As far as I found out, this plugin uses barcodescanner-release-2.1.5.aar form here https://github.com/EddyVerbruggen/barcodescanner-lib-aar , correct?

On that page, @EddyVerbruggen says:
Update any source files as needed (current version is: https://github.com/zxing/zxing/releases/tag/BS-4.7.6)

However that version 4.7.6 is from September 2016. Current newest version 4.7.7 is from October 2017. So my question is, is it possible to perhaps update version of BS (Barcode Scanner) used from ZXing to current 4.7.7 ?

In ZXyng, there is a commit that did something around this very row, where the error appears from:
zxing/zxing@2f11529#diff-3ea115340f67fb0e31e24e4cd9ae7582

So updating Barcode Scanner.aar would update also ZXyng engine used in Barcode Scanner.aar and if problem persist, I know it is still not fixed problem of ZXyng. In that case I can open issue there. Until then, I can not be sure whether the mentioned commit was or was not included in currently used 4.7.6.

Hope it makes a sense :-)
What do you think?

@NBAMj
Copy link

NBAMj commented Feb 27, 2018

One of my users is facing a similar issue with ZXing library and the crash log looks similar to what you have mentioned.
Android Version is 6.0

Would love to see if there is any update on this issue.

@bennuer
Copy link

bennuer commented Mar 14, 2018

I have detected a similar error on a device with android 7.

Camera error after opening.

@jarekskuder
Copy link

Same here, only my app crashes immediately after i open scanner

@fttx
Copy link
Contributor

fttx commented Jun 28, 2018

same here

@michielsebille
Copy link

Also on windows 8.1 this issue

@bpetty-formfast
Copy link

@michielsebille , as for the comment about Windows, we were getting the same behavior but were able to get around it by creating a published version. In VS go to Project/Store/Create App Packages. A regular release build would pop up and instantly crash, but having not looked at an error log I can't say if it is related.

@Alipric2019
Copy link

Same here, too.

@CeloGomesBR
Copy link

I really need this barcode scanner works on Android 6, at least!!!

@CristianoGil
Copy link

I have same problem.

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

No branches or pull requests