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

2
  • you need to include the google play services library. Commented Aug 24, 2013 at 15:06
  • see my answer maybe helpful. Commented Aug 24, 2013 at 15:15

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

I am not familiar with Android Studio but for eclipse its Project-> clean. You may want to follow these instructions. stackoverflow.com/questions/17135099/…
a tutorial i found said rebuuild is the same as clean in android studio but it did not fix my problem
-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"/> 

1 Comment

This looks pretty much identical to the fragment in the question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.