Google Maps Google: XML Layout Errors

I am trying to get google maps v2 to work in android using android studio. I have all the keys and the manifest. When I try to create xml for the actual activity that the map will display, I get errors. My xml looks like 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" > <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/> </RelativeLayout> 

My error in Android studio is as follows:

enter image description here

0
source share
2 answers

This is happening to me. Just clean the project.

+1
source

hi you should use this code in the xml file:

 <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" android:name="com.google.android.gms.maps.SupportMapFragment"/> 
-one
source

Source: https://habr.com/ru/post/1502394/


All Articles