“Canvas: trying to draw too large bitmap” when Android N Display Size set larger than Small

后端 未结 12 1324
清酒与你
清酒与你 2020-11-27 14:51

I have a published app that is crashing at startup on Android N when the newly introduced Display size OS setting is set to too large a value.

When I lo

相关标签:
12条回答
  • 2020-11-27 15:17

    I don't know would it help some one, but I'll just leave it here. In my case - problem was only on Sumsung devices with Android 7, and problem was in splash screen proportions. after changing height to 1024 px - everything works fine

    0 讨论(0)
  • 2020-11-27 15:19

    Move your image in the drawable to mipmap-xxhdpi.Your image is in bitmap format so you should put your image in mipmap folder,then it will work

    0 讨论(0)
  • 2020-11-27 15:20

    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.

    The splash screen in my case has xxhdpi resolution, and it was mistakenly placed in the drawable folder, instead of drawable-xxhdpi. This made Android assume the splash screen had mdpi resolution and scale the image to 3*3 times it's required size and trying to create a bitmap.

    0 讨论(0)
  • 2020-11-27 15:21

    if you use Picasso change to Glide like this.

    Remove picasso

    Picasso.get().load(Uri.parse("url")).into(imageView)
    

    Change Glide

    Glide.with(context).load("url").into(imageView)
    

    More efficient

    0 讨论(0)
  • 2020-11-27 15:21

    if you are using glide and you are loading 1k of images at a time or some images then it is issue of glide or whatever you are doing to use to set the image view. you can resolve it just by applying scale type in glide.

    0 讨论(0)
  • 2020-11-27 15:22

    The icon files are too large for Android to efficiently and smoothly load. Android recognizes this with its smart algorithms.

    You can resize the icon files using Final Android Resizer by asystat. Resize them to "xhdpi" or lower.

    Place the resized photos in drawable or overwrite over the existing large icon files.

    Then, you're done.

    0 讨论(0)
提交回复
热议问题