Android Studio: Rendering Problems Missing styles-correct theme chosen for this layout, Failed to find style with id -
i want create card item xml layout cardview
, getting error. common solutions here not worked (tried them , others similar posts).
this xml
:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.cardview xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardcornerradius="3dp" card_view:cardelevation="4dp"> </android.support.v7.widget.cardview> </relativelayout>
this relevant part of styles.xml
:
<!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="colorprimary">@color/primary</item> <item name="colorprimarydark">@color/primary_dark</item> <item name="coloraccent">@color/primary_accent</item> </style> <!--theme tool bar (action bar)--> <style name="toolbartheme" parent="themeoverlay.appcompat.actionbar"> <item name="android:textcolorprimary">@color/white</item> </style>
this relevant part manifest
:
<application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" >
this relevant part gradle build
script:
compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.google.android.gms:play-services:8.1.0' compile 'com.android.support:design:23.0.1' compile 'com.android.support:cardview-v7:23.0.1' compile 'com.android.support:recyclerview-v7:23.0.1'
and error:
thanks,
i facing same issue. please restart android studio selecting menu option "file" → "invalidate caches / restart". more details please follow link:
Comments
Post a Comment