android:Theme.Material.Light requires API level 21 (current min is 8)

For this you need to have 2 values folders.

One that exists by default, and another, you have to create in your res folder and name it values-v21.

In the default values folder, in styles.xml, use a theme other than Material theme.
And in the styles.xml of values-v21 folder that you created, use Material theme.

Android phone will automatically pickup the styles.xml which it supports. If the phone supports Material Design (Lollipop devices), your app will use Material theme (values-21 folder).

If it doesn’t (in phones running older Android versions), the default values folder will be used.

Leave a Comment