Ahmed Hossam
Ahmed Hossam

Reputation: 21

Google maps activity wont show in designer

the code runs with no error, but the designer gives me error and will not appear

enter image description here

Cycle found (count=51) evaluating 'activity_nearby_places' with pathString="file:///c:/ path="C:\New folder (148)\GaspriceinEgypt\app\src\main\res\layout\activity_nearby_places.xml" stratIndex=3 suffixEndIndex=3 separator='\\"(parserfile=file:\\\\ C:\New folder (148)\GaspriceinEgypt\app\src\main\res\layout\activity_nearby_places.xml)

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:map="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/map"
  android:name="com.google.android.gms.maps.SupportMapFragment"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context=".NearbyPlaces"
  tools:layout="@layout/activity_nearby_places" />

Upvotes: 1

Views: 977

Answers (1)

IAmGroot
IAmGroot

Reputation: 13855

It looks like you have created a recurring loop / Cycle.

The tools:layout should not be reffering to the file you are in, but instead, some example layout file that you want the designer to display.

From the docs: This attribute declares which layout you want the layout preview to draw inside the fragment (because the layout preview cannot execute the activity code that normally applies the layout).

Try deleting the tools:layout= line. or putting something more appropriate inside it.

https://developer.android.com/studio/write/tool-attributes#toolslayout

Upvotes: 2

Related Questions