Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Canvas: trying to draw too large(119501824bytes) bitmap. #284

Open
iman2420 opened this issue Apr 16, 2018 · 4 comments
Open

Canvas: trying to draw too large(119501824bytes) bitmap. #284

iman2420 opened this issue Apr 16, 2018 · 4 comments

Comments

@iman2420
Copy link

When i try to crop big image file, app is crashed.

When I look in logcat, I see the following message:

          ` --------- beginning of crash
    04-16 10:28:54.748 5581-5581/com.android.quizz E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.android.quizz, PID: 5581
    java.lang.RuntimeException: Canvas: trying to draw too large(119501824bytes) bitmap.
    at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1415)
    at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545)
    at android.widget.ImageView.onDraw(ImageView.java:1286)
    at com.soundcloud.android.crop.CropImageView.onDraw(CropImageView.java:185)
    at android.view.View.draw(View.java:17071)
    at android.view.View.updateDisplayListIfDirty(View.java:16053)
    at android.view.View.draw(View.java:16837)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
    at android.view.View.updateDisplayListIfDirty(View.java:16048)
    at android.view.View.draw(View.java:16837)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
    at android.view.View.updateDisplayListIfDirty(View.java:16048)
    at android.view.View.draw(View.java:16837)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
    at android.view.View.updateDisplayListIfDirty(View.java:16048)
    at android.view.View.draw(View.java:16837)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
    at android.view.View.draw(View.java:17074)
    at com.android.internal.policy.DecorView.draw(DecorView.java:751)
    at android.view.View.updateDisplayListIfDirty(View.java:16053)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:656)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:662)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:770)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:2796)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2604)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2211)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
    at android.view.Choreographer.doCallbacks(Choreographer.java:683)
    at android.view.Choreographer.doFrame(Choreographer.java:619)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
    04-16 10:28:54.749 1663-1799/system_process W/ActivityManager:   Force finishing activity com.android.xxx/com.soundcloud.android.crop.CropImageActivity`

Selected image info:

  • Size: 1.6 MB
  • Resolution: 71 MP
  • Dimensions: 11658x6112
    Does this have anything to do with crop ?
@THEONE10211024
Copy link

same on me !

@TravellersGazette
Copy link

put those .jpeg,gif,png in the mipmap folder and then assign them and then run the app !
It worked for me , and will for you too ,

@djsteven31
Copy link

djsteven31 commented Feb 6, 2019 via email

@ChetnaNakum
Copy link

In my case, moving the splash bitmap from drawable to drawable-xxxhdpi was the solution.

I had the same problem. I didn't suspect my splash screen to be the problem since it is displayed when the app is started, but it turned out the splash screen is the problem.

The splash screen in my case has xxxhdpi resolution, and it was mistakenly placed in the drawable folder, instead of drawable-xxxhdpi.

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

No branches or pull requests

5 participants