0

I am trying to get google maps v2 to work in android using android studio. I got all my keys and manifest setup. When I try and create xml for the actual activity that the map will show up on 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 looks like this:

enter image description here

Mike
  • 6,751
  • 23
  • 75
  • 132

2 Answers2

1

This happens to me as well. Simply clean the project.

wakaka
  • 533
  • 1
  • 7
  • 21
  • I am not familiar with Android Studio but for eclipse its Project-> clean. You may want to follow these instructions. http://stackoverflow.com/questions/17135099/android-studio-with-gradle-and-google-maps-v2 – wakaka Aug 24 '13 at 14:55
  • a tutorial i found said rebuuild is the same as clean in android studio but it did not fix my problem – Mike Aug 24 '13 at 14:57
-1

hi you must use this code in 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"/>