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

java.lang.RuntimeException: Canvas: trying to draw too large(192000000bytes) bitmap #104

Closed
shiesteh opened this issue Jul 30, 2020 · 1 comment
Milestone

Comments

@shiesteh
Copy link

shiesteh commented Jul 30, 2020

Hi, When selected large image size(20MB) the app crashed and force closed.
java.lang.RuntimeException: Canvas: trying to draw too large(192000000bytes) bitmap

2020-07-30 19:59:32.916 19410-19410/ir.nozhin.nozhin E/AndroidRuntime: FATAL EXCEPTION: main
Process: ir.nozhin.nozhin, PID: 19410
java.lang.RuntimeException: Canvas: trying to draw too large(192000000bytes) bitmap.
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:229)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:98)
at com.yalantis.ucrop.util.FastBitmapDrawable.draw(FastBitmapDrawable.java:41)
at android.widget.ImageView.onDraw(ImageView.java:1360)
at android.view.View.draw(View.java:20234)
at android.view.View.updateDisplayListIfDirty(View.java:19109)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.draw(View.java:20237)
at android.view.View.updateDisplayListIfDirty(View.java:19109)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.updateDisplayListIfDirty(View.java:19100)
at android.view.View.draw(View.java:19962)
at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
at android.view.View.draw(View.java:20237)
at com.android.internal.policy.DecorView.draw(DecorView.java:784)
at android.view.View.updateDisplayListIfDirty(View.java:19109)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3402)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3199)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2558)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1535)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7405)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1044)
at android.view.Choreographer.doCallbacks(Choreographer.java:839)
at android.view.Choreographer.doFrame(Choreographer.java:774)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1030)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6864)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

@shiesteh shiesteh changed the title Large image crashed! Large image size crashed! Jul 30, 2020
@shiesteh shiesteh changed the title Large image size crashed! java.lang.RuntimeException: Canvas: trying to draw too large(192000000bytes) bitmap Aug 6, 2020
@Dhaval2404 Dhaval2404 added this to the v1.8 milestone Dec 18, 2020
Dhaval2404 added a commit that referenced this issue Dec 18, 2020
Fixed OutOfMemory Issue for large images

#122 #104
@Dhaval2404
Copy link
Owner

Duplicate of #122

@Dhaval2404 Dhaval2404 marked this as a duplicate of #122 Dec 21, 2020
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