Closed hfierro closed 4 years ago
Same question
java.lang.ArithmeticException
divide by zero
2 com.journeyapps.barcodescanner.j.b(:461) 3 com.journeyapps.barcodescanner.j.b(:59) 4 com.journeyapps.barcodescanner.f.handleMessage(:199) 5 android.os.Handler.dispatchMessage(Handler.java:108) 6 android.os.Looper.loop(Looper.java:216) 7 android.app.ActivityThread.main(ActivityThread.java:7625) 8 java.lang.reflect.Method.invoke(Native Method) 9 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 10 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Huawei MHA AL00 Android 9,level 28
please update android zxing library 'com.journeyapps:zxing-android-embedded:4.1.0'
I'm seeing this error too in Xiaomi and Motorola devices. Any update?
@VytorCalixto Update the dependency as mentioned above. You can clone the repository, change the build.gradle file to use the latest version (anything above 4.0 will do) and include the package via path in your pubspec.yaml file:
qrcode: path: ./../qrcode/qrcode
instead of
qrcode: ^1.0.4
I did this here: https://github.com/WasserEsser/qrcode
Thanks @WasserEsser! Do you know why this hasn't been merged to master? Should be an easy PR to fix this issue, right?
Some devices throw a divide by zero exception, mostly present in Huawei and Samsung devices.
Camera is shown correctly and qr codes are scanned correctly too.
Fatal Exception: java.lang.ArithmeticException: divide by zero at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(CameraPreview.java:389) at com.journeyapps.barcodescanner.CameraPreview.previewSized(CameraPreview.java:461) at com.journeyapps.barcodescanner.CameraPreview.access$300(CameraPreview.java:59) at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(CameraPreview.java:199) at android.os.Handler.dispatchMessage(Handler.java:108) at android.os.Looper.loop(Looper.java:216) at android.app.ActivityThread.main(ActivityThread.java:7625) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)