Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error on @style/Apptheme and Style.xml file doesn't exist

Tags:

android

when i created a Android Application Project, i've got an error in AndroidManifest.xml on (android:theme="@style/AppTheme") No resource found that matches the given name (at 'theme' with value '@style/AppTheme'). and under (/res/values/) repertory, there is only strings.xml.

like image 878
ZAIRI Oussama Avatar asked Nov 16 '25 07:11

ZAIRI Oussama


1 Answers

I'm not sure how you started a new Android project, but something might went wrong. Inside you app folder you should have /res/values/styles.mxl. Without going too much into it, it should look something like this (taken from the Using the Material Theme, you'll want to support previous versions as well):

<resources>
  <!-- inherit from the material theme -->
  <style name="AppTheme" parent="android:Theme.Material">
    <!-- Main theme colors -->
    <!--   your app branding color for the app bar -->
    <item name="android:colorPrimary">@color/primary</item>
    <!--   darker variant for the status bar and contextual app bars -->
    <item name="android:colorPrimaryDark">@color/primary_dark</item>
    <!--   theme UI controls like checkboxes and text fields -->
    <item name="android:colorAccent">@color/accent</item>
  </style>
</resources>
like image 175
Assaf Gamliel Avatar answered Nov 18 '25 23:11

Assaf Gamliel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!