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

v4.2.0 crashes on pre-lollipop android devices #645

Closed
ShivamPokhriyal opened this issue Aug 6, 2021 · 2 comments
Closed

v4.2.0 crashes on pre-lollipop android devices #645

ShivamPokhriyal opened this issue Aug 6, 2021 · 2 comments

Comments

@ShivamPokhriyal
Copy link

ShivamPokhriyal commented Aug 6, 2021

Description of the problem:

The readme has instructions for using the latest version on older API levels https://github.com/journeyapps/zxing-android-embedded#older-sdk-versions, but when used, the app crashes on devices running on API < 21.

The reason for the crash is the use of AudioAttributes introduced in this PR #587. AudioAttributes was added in API level 21.

Related Issue: #643

We should probably update the README and explicitly mention that the latest version isn't compatible with API < 21 devices.

Which library version are you using? E.g. 4.2.0.

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0)
Android 4.4.2 and 4.4.4

In the case of an error do you have a stack trace or adb logs?

Fatal Exception: java.lang.NoClassDefFoundError: android.media.AudioAttributes$Builder
       at com.google.zxing.client.android.BeepManager.playBeepSound(BeepManager.java:97)
       at com.google.zxing.client.android.BeepManager.playBeepSoundAndVibrate(BeepManager.java:84)
       at com.journeyapps.barcodescanner.CaptureManager$1.barcodeResult(CaptureManager.java:80)
       at com.journeyapps.barcodescanner.DecoratedBarcodeView$WrappedCallback.barcodeResult(DecoratedBarcodeView.java:50)
       at com.journeyapps.barcodescanner.BarcodeView$1.handleMessage(BarcodeView.java:52)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5584)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
       at dalvik.system.NativeStart.main(NativeStart.java)
@ShivamPokhriyal ShivamPokhriyal changed the title Crashes on API < 21 v4.2.0 crashes on pre-lollipop android devices Aug 31, 2021
@ShivamPokhriyal
Copy link
Author

FYI @rkistner @ANewGalaxy

This was referenced Oct 25, 2021
@rkistner
Copy link
Member

Fixed in v4.3.0

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

No branches or pull requests

2 participants