I\'m trying to upgrade my app from API19 to API21
The main changes I\'ve made to the gradle properties are:
compileSdkVersion 21
buildToolsVersion \"
I had the same problem when trying to use ?attr/selectableItemBackground and based on your answer and some digging around on the internet I found out what was wrong for me (and probably you as well).
From this answer I learned that "? mark is used to reference style in current theme." Which means that when you use ?attr/ you refer to something in the current theme.
I noticed that I got this crash only when inflating using the application context and not when using the activity context. This blog post explains what's happening in "Context Capabilities" section.
...[When using the application context] inflation will be done with the default theme for the system on which you are running, not what’s defined in your application.
This mean that ?attr/ won't work since they refer to the current theme, not the default system theme you're inflating with.
So ?attr/ works fine if you make sure to inflate using the Activity context instead of the application context.