Reputation: 342
I have a problem with the API Level 21. I want to use the Material Design and still be able to run the application on lower API levels like 18 (Android 4.3.1). But I always get that error:
My manifest SDK looks like that:
And the build.gradle like that:
Hope this is enougth information to get some help, I really need it :(
Cheers.
Upvotes: 6
Views: 2364
Reputation: 363895
As described in doc : https://developer.android.com/training/material/theme.html
Note: The material theme is only available in Android 5.0 (API level 21) and above
This means that you have to use the values-v21 folder for your Material Theme.
However you can use the v7 Support Libraries to provide themes with material design styles for some widgets. This is an example, using the AppCompat Theme.
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
<!-- Here we setting appcompat’s actionBarStyle -->
<item name="actionBarStyle">@style/MyActionBarStyle</item>
<!-- ...and here we setting appcompat’s color theming attrs -->
<item name="colorPrimary">@color/my_awesome_red</item>
<item name="colorPrimaryDark">@color/my_awesome_darker_red</item>
<!-- The rest of your attributes -->
</style>
More info here: https://chris.banes.me/2014/10/17/appcompat-v21/
Upvotes: 8