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

Crash : java.lang.ArithmeticException: divide by zero #334

Closed
yashasvigirdhar opened this issue Oct 13, 2017 · 17 comments
Closed

Crash : java.lang.ArithmeticException: divide by zero #334

yashasvigirdhar opened this issue Oct 13, 2017 · 17 comments

Comments

@yashasvigirdhar
Copy link

Description of the problem:

Which library version are you using? 3.5.0.

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

Samsung - Android 7

Does the same happen on other devices or an emulator? No

Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?
No

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

Fatal Exception: java.lang.ArithmeticException: divide by zero
       at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(SourceFile:389)
       at com.journeyapps.barcodescanner.CameraPreview.previewSized(SourceFile:461)
       at com.journeyapps.barcodescanner.CameraPreview.access$300(SourceFile:59)
       at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(SourceFile:199)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6692)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
@noritoshi
Copy link

Maybe same problem.
I got the bug report from Crashlytics at Nov 17 2017 18:36 (UTC).
I'm not sure it was caused by the library or a mistake in my code.

Description of the problem:

Which library version are you using? 3.5.0.

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

Galaxy A8 - Android 6.0.1

Does the same happen on other devices or an emulator? No

Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?
No

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

Fatal Exception: java.lang.ArithmeticException: divide by zero
at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(CameraPreview.java:8389)
at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(CameraPreview.java:199)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

@alexisv6
Copy link

alexisv6 commented Jan 12, 2018

I have the same problem
Description of the problem:
Which library version are you using? 3.5.0.

Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,Android 5.0) Samsung Galaxy Tab A 8.0/9.7 - Android 6/7

Does the same happen on other devices or an emulator? No just Samsung so far

Can you reproduce the issue in the sample project included with the library? If not, can you provide your own sample project or sample code that produces this error? No

**In the case of an error do you have a stack trace or adb logs?
Fatal Exception: java.lang.ArithmeticException: divide by zero at com.journeyapps.barcodescanner.CameraPreview.calculateFrames(SourceFile:389) at com.journeyapps.barcodescanner.CameraPreview.previewSized(SourceFile:461) at com.journeyapps.barcodescanner.CameraPreview.access$300(SourceFile:59) at com.journeyapps.barcodescanner.CameraPreview$3.handleMessage(SourceFile:199) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)

@nitintechjini
Copy link

I am also facing this issue. Any fix for this.

@kiran-choudhary
Copy link

Please let me know if is there any fix for this issue

@MKSMV
Copy link

MKSMV commented Jul 27, 2018

Hello @rkistner , should we wait for changes?

@karmil32
Copy link

Same problem here. Library version: 3.6.0

Fatal Exception: java.lang.ArithmeticException divide by zero com.journeyapps.barcodescanner.CameraPreview.calculateFrames (SourceFile:385) com.journeyapps.barcodescanner.CameraPreview.previewSized (SourceFile:469) com.journeyapps.barcodescanner.CameraPreview.access$300 (SourceFile:60) com.journeyapps.barcodescanner.CameraPreview$3.handleMessage (SourceFile:200) android.os.Handler.dispatchMessage (Handler.java:101) android.os.Looper.loop (Looper.java:164) android.app.ActivityThread.main (ActivityThread.java:6944) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

@albo1337
Copy link

facing the same problem

@r-cohen
Copy link

r-cohen commented Dec 21, 2018

+1
Same issue here. Are you accepting pull requests?

@soenkegissel
Copy link

same here.

@AlCabohne
Copy link

Here as well, any news on this issue?

@kevag
Copy link

kevag commented Feb 15, 2019

We are facing exactly the same bug at random times with Samsung Galaxy S8 Plus(Android version : 8.0.0) and Samsung Galaxy J7 Prime(Android version : 8.1.0) phones.
Is there any update on this issue?

BRS / Kostas

@ljfantin
Copy link

Any news about this issue ?

@Cylix
Copy link

Cylix commented May 3, 2019

Any plan to merge these fixes? Is this library still maintained?

@rkistner
Copy link
Member

rkistner commented Sep 7, 2019

Should be fixed in v4.0.2.

@FrantisekGazo
Copy link

@rkistner can you please add a fix to 3.x version as well?

I'm asking cause our app needs to support android api 21 so we cannot upgrade to 4.x version

@FrantisekGazo
Copy link

Can you please answer?
If you plan to completely abandon lower android api then 24 could you at least write how you fixed it so maybe I could fork your repo and fix it there at least?

@rkistner
Copy link
Member

The fixes won't be backported.

You can use the latest versions with Android API 14+, either by:

  1. Downgrading zxing:core - see https://github.com/journeyapps/zxing-android-embedded#older-sdk-versions
  2. OR by using AGP - see Correct minSdkVersion to 19 #612

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