Error : RuntimeException at DisplayListCanvas.throwIfCannotDraw

My application work very well on nougat emulator and many devices, but i found this exception in google play crash reporter, I don't know why it happened, The exception causes with nougat devices ++ only.

the exception :

   java.lang.RuntimeException: 
  at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)
  at android.graphics.Canvas.drawBitmap(Canvas.java:1420)
  at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:545)
  at android.view.View.getDrawableRenderNode(View.java:18591)
  at android.view.View.drawBackground(View.java:18527)
  at android.view.View.draw(View.java:18315)
  at android.view.View.updateDisplayListIfDirty(View.java:17302)
  at android.view.View.draw(View.java:18086)
  at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
  at android.view.View.updateDisplayListIfDirty(View.java:17297)
  at android.view.View.draw(View.java:18086)
  at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
  at android.view.View.updateDisplayListIfDirty(View.java:17297)
  at android.view.View.draw(View.java:18086)
  at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
  at android.view.View.updateDisplayListIfDirty(View.java:17297)
  at android.view.View.draw(View.java:18086)
  at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
  at android.view.View.updateDisplayListIfDirty(View.java:17297)
  at android.view.View.draw(View.java:18086)
  at android.view.ViewGroup.drawChild(ViewGroup.java:3966)
  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3752)
  at android.view.View.draw(View.java:18327)
  at com.android.internal.policy.DecorView.draw(DecorView.java:919)
  at android.view.View.updateDisplayListIfDirty(View.java:17302)
  at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:692)
  at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:698)
  at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:806)
  at android.view.ViewRootImpl.draw(ViewRootImpl.java:3135)
  at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2931)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2523)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1522)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7098)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
  at android.view.Choreographer.doCallbacks(Choreographer.java:702)
  at android.view.Choreographer.doFrame(Choreographer.java:638)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
  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:6682)
  at java.lang.reflect.Method.invoke(Native Method:0)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

What this error could be?

CAUTION: all drawable i used is less than 1MB.

I had the exact same problem with Samsung Galaxy S6 S7 S8. In my case Splash Screen had high resolution and it was mistakenly placed in the drawable folder. I found solution from this answer.

  1. Right Click on drawable -> New -> Directory.
  2. Enter new directory name: xxhdpi. It will create a new folder named drawable-xxhdpi if you go to res
  3. Move your splash image from drawable to drawable-xxhdpi.

Android 8 incompatibility, RuntimeException being thrown from DisplayListCanvas.throwIfCannotDraw. This seems to throwIfCannotDraw (DisplayListCanvas.java:229) at android.​view. I think your problem that you try open too large image. Notes. I my case, moving the (hi-res) splash bitmap from drawable to drawable-xxhdpi 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.

Just Resize your image in my case my Splash screen image dimensions are 1544x2100 so i changed to 1080x2100 and that will work!! Hope this will help!!! Thanks!!!

Crash on many versions: RuntimeException: Canvas: trying to draw , Crash on many versions: RuntimeException: Canvas: trying to draw too large bitmap # throwIfCannotDraw(DisplayListCanvas.java:260) at android.graphics. I didn't suspect my splash screen to be the problem, since it is  If the image is very large I see this error: java. lang. RuntimeException: Canvas: trying to draw too large (213828900bytes) bitmap. at android. view. DisplayListCanvas. throwIfCannotDraw (DisplayListCanvas. java: 260) at android. graphics. Canvas. drawBitmap (Canvas. java: 1415) The stack does not reach my code. How can I catch this error?

Try to set a debug point in android.view.DisplayListCanvas.throwIfCannotDraw and check what image is throw an exception. Some of them is incorrect - large size or you have too many images for example and cant record to canvas pool.

App stops working while runninggetting this err, RuntimeException: Canvas: trying to draw too large(192000000bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(  Do it progamatically, Try this. ImageView icon = new ImageView(this); // Create an icon icon.setImageDrawable(getResources().getDrawable(R.drawable.add_user)); //set the appropriate background for the main floating action button along with its icon FloatingActionButton factionButton = new FloatingActionButton.Builder(this) .setContentView(icon) .setBackgroundDrawable(R.drawable.selector

Expo SDK 33 Android standalone build crashes, I think this is the error: java.lang.RuntimeException: Canvas: trying to draw too throwIfCannotDraw(DisplayListCanvas.java:229) Describe the bug 🐛 Set up a very simple test project. When scrolling down the results, the app crashes with the following error: java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap To Reproduce 🔍 S

[#MOBILE-2287] App crashing on launch after install on Android N , RuntimeException: Canvas: trying to draw too large(110722260bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(  I my case, moving the (hi-res) splash bitmap from drawable to drawable-xxhdpi 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.

Hangouts app ( 31.0.0246194187 ) keeps crashing (MIUI 10 , Crash on many versions: RuntimeException: Canvas: trying to draw too large bitmap. Maybe resize the image before displaying can fix this bug, and optimize all of them throwIfCannotDraw(DisplayListCanvas.java:261) Can you help out for this issue. open image then crash the app Log :- Fatal Exception: java.lang.RuntimeException: Canvas: trying to draw too large(113598720bytes) bitmap. at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCa

Comments
  • I have the exact same problem with samsung galaxy s6 s7 and s8. If u find a solution please share it with us
  • I don't have much images, and i can't debug on this method.
  • after debug on other method i found this bitmap : android.graphics.bitmap@7od1086
  • Is your images in drawable folder? Try to move on drawable_hdpi folder. It can help. Check this link: stackoverflow.com/questions/39111248/…