IllegalArgumentException: width and height must be > 0 in activity

后端 未结 1 1281
挽巷
挽巷 2021-01-13 01:25

When running my app on a tablet rather then on a phone (which I\'ve never tried before) I get this stack trace when I start a certain activity. I have looked through the .xm

相关标签:
1条回答
  • 2021-01-13 01:30

    It sounds like you may be using the support library? I had the same error and traced it to a bug with DrawableCompat.wrap() in 23.4.0 that doesn't exist in earlier & later versions of the support library. This bug incorrectly sets the drawable bounds to 0 (or negative in the case of an inset drawable). I've seen this cause a crash on Android 5.1.

    I didn't see a specific issue opened for this, but looking at the code for DrawableWrapperDonut/DrawableWrapperGingerbread, I can see that the problem was introduced around 23.4.0 and later fixed, so if you were using the buggy version, switching to a good version should fix this crash.

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