Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing styles, Using CardView in android studio

With CardView as root layout in xml file(for a custom view), i get an error from android studio-

Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style with id 0x7fff000e in current theme .

I tried choosing different themes for the layout, none worked it seems.
I am using the new appCompatActivity in my app.
any theme works fine with the old ActionBarActivity.

like image 730
Harshit Avatar asked Jun 15 '15 22:06

Harshit


Video Answer


2 Answers

Adding the elements below to the AppTheme helped me to solve a similar problem

    <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primary_dark</item>
    <item name="colorAccent">@color/accent</item>
like image 189
art Avatar answered Oct 02 '22 11:10

art


I guess this is a bit ate for your question but just in case someone needs it:

Mine was solved after restarting android studio using the below option:

File -> Invalidate Caches/Restart...

like image 23
Shreyash Jain Avatar answered Oct 02 '22 13:10

Shreyash Jain