I had the same problem as soon as I moved the map fragment to FrameLayout (so that I could add a button on top of the map).
I don't know what I really did, since I am noob in Android apps and XML, but it looks like I found a solution :-)
I tried to do the trick, including the fragment, from a separate file (using the 'include' directive), and as soon as I put the exposed fragment of the map without any namespace definitions, he offered me 2 options: XMLNS: map = "http: / /schemas.android.com/apk/res-auto "XMLNS: map =" http://schemas.android.com/tools "I realized that maybe the second one will work in the original file (although in the original Android Studio file does not offer it, but only the 1st).
Conclusion: Just change this line: XMLNS: map = "http://schemas.android.com/apk/res-auto" with this: XMLNS: map = "http://schemas.android.com/tools"
HOW I APPLIED - I AM MY AND CAN MAY DECIDE THAT SOME SIDE SIDE EFFECTS, PLEASE, LET THAT YOU CAN KNOW IF IF THIS (although everything seemed to work fine so far ...).
What is my working map layout with a button on top and without errors:
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:map="http://schemas.android.com/tools" tools:context="com.maverickrider.myapp.inviteActivity.MapsActivity" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/purpura_E51B4A"> <fragment android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/map" android:name="com.google.android.gms.maps.MapFragment" map:cameraTargetLat="51.513259" map:cameraTargetLng="-0.129147" map:cameraTilt="30" map:cameraZoom="13" /> <Button android:id="@+id/startActivityButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal|center_vertical" android:onClick="cokolwiek" android:text="Baton z dupy" android:layout_alignParentBottom="true" /> </FrameLayout >
source share