3

I am setting up google map v2 in Android. I am using the new technique on adding dependency using this link."Android Studio with Google Play Services"

It did nice after synchronization, clean project and rebuild project. However I could not find the MapActivity. What seems to be the problem?

Build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services:4.2.42'
}
Community
  • 1
  • 1
The One
  • 1,085
  • 6
  • 13
  • 25

1 Answers1

9

MapActivity was part of the Google Maps Android v1 API which is now deprecated.

Using the Google Play Services library you will use the Google Maps Android API v2 and then MapActivity is not available anymore. You need to use the MapFragment.

You can see an introduction on how to use the MapFragment in the official documentation.

rciovati
  • 27,603
  • 6
  • 82
  • 101
  • Yeah, I had check the classes in the Jar files and I could not found MapActivity... Man, the book that I am looking is already redundant. – The One Mar 13 '14 at 00:31