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)
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 https://github.com/journeyapps/zxing-android-embedded/pull/587. AudioAttributes was added in API level 21.Related Issue: https://github.com/journeyapps/zxing-android-embedded/issues/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?