Cyclic include, not valid error while creating fragment android -


i creating fragment display map. have done someting this:-

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" >  <spinner     android:id="@+id/spr_place_type"     android:layout_width="wrap_content"     android:layout_height="60dp"     android:layout_alignparenttop="true" />  <button     android:id="@+id/btn_find"     android:layout_width="wrap_content"     android:layout_height="60dp"     android:layout_alignparenttop="true"     android:layout_torightof="@id/spr_place_type"     android:text="@string/str_btn_find" />  <fragment     android:id="@+id/map"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_alignparentbottom="true"     android:layout_below="@id/spr_place_type"     class="com.google.android.gms.maps.supportmapfragment"    /> 

but in graphical layout, can see following error:-

enter image description here

when right click , choose fragment layout further see following error:-

enter image description here

how can resolve following error.

you cannot put main activity layout fragment inside main activity layout. that's "cyclic include" error means.

you don't seem have fragment layout readily available. can click on "new layout..." button create new one.


Comments