Error inflating class ImageButton

This exception

02-17 05:42:39.445 3247-3247/com.example.siddhi.timetablelayout E/AndroidRuntime: Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 02-17 05:42:39.445 3247-3247/com.example.siddhi.timetablelayout E/AndroidRuntime: at android.content.res.TypedArray.getColor(TypedArray.java:326) 02-17 05:42:39.445 3247-3247/com.example.siddhi.timetablelayout E/AndroidRuntime: at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:967) 02-17 05:42:39.445 3247-3247/com.example.siddhi.timetablelayout E/AndroidRuntime: at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:885)

leads to the conclusion that this line <solid android:color="?attr/colorAccent" /> in fab_selector is the culprit. Try to change color to HEX value and then test.

hope this helps.


Yes. You need to create a folder like 'drawable-v21'.