Error inflating class ImageView

前端 未结 17 2427
失恋的感觉
失恋的感觉 2020-12-29 21:01

I\'ve been getting InflateException/ClassNotFoundException error intermittently. I\'ve seen similar errors before in SO but they were caused by spelling errors. I spelled \'

17条回答
  •  太阳男子
    2020-12-29 22:02

    It's an old question but I just came across the same problem. In my case it was caused by using the android:tint attribute with an selector rather than a color:

    
    

    While this works without a problem a SDK 21+ it crashes in older versions...

    Switching to AppCompatImageView and to app:tint solved the problem:

    
    

提交回复
热议问题