2017-07-18 1 views
0

Ich versuche, eine Karte Aktivität mit dem folgenden XML zu bauen:Karte Fragment Rendering Fehler

<com.google.android.gms.maps.MapView 
    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/mapView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

<fragment 
    android:id="@+id/map" 
    android:name="com.google.android.gms.maps.SupportMapFragment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.getfamiliarwiththemap.MapsActivity" > 



    <LinearLayout 
     android:id="@+id/mLlayoutBottomButtons" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_alignParentBottom="true" 
     android:orientation="vertical" > 

    <Button 

    android:id="@+id/ok" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Select" 
    android:textColor="#ffec00" 
    android:background="#b600ff" 
     android:layout_marginBottom="5dp" 
     android:layout_marginTop="500dp" 
     android:layout_marginLeft="150dp" 
     android:layout_marginRight="150dp" 

    /> 

    </LinearLayout> 

</fragment> 

    </com.google.android.gms.maps.MapView> 

Und ich bekomme immer wieder die Rendering-Fehler: Unknown Fragment Kann mir jemand den richtigen Weg lehren dieses Google installieren Play Services SDK MANUELL? Ich habe einen Ordner namens google_play_services und das ist alles, was ich verwenden möchte.

+0

Mögliche Duplikat [Android Studio Google Map V2 Fragment Rendering] (https://stackoverflow.com/questions/23898992/android-studio-google-map- v2-fragment-rendering) –

+0

Und kannst du mir sagen, welche Antwort soll ich beachten? : | @Jace J McPherson Alle u Jungs wissen, wie man Duplikate bust ... –

+0

Es scheint, als ob Sie in der Lage sein sollten, die Antworten auf diesen Beitrag zu lesen und herauszufinden, was Sie tun möchten. Sie können dieses Fragment nicht rendern, ohne ein eigenes benutzerdefiniertes Layout zu erstellen. Ich werde keine Antwort auf eine Frage hinterlassen, die bereits anderswo beantwortet wurde. Den Link zur Verfügung zu stellen, war die hilfreichste Sache, die ich machen konnte. –

Antwort

-1

Versuchen Sie es mit class statt android:name:

<fragment 
    android:id="@+id/map" 
    class="com.google.android.gms.maps.SupportMapFragment" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="com.example.getfamiliarwiththemap.MapsActivity" > 
+0

Ich habe das versucht und ich habe: Keine Ressourcen-ID für Attribut 'Klasse' im Paket 'Android' gefunden –