找不到 MapActivity.安卓工作室 0.5.1 [英] MapActivity could not be found. Android Studio 0.5.1

查看:35
本文介绍了找不到 MapActivity.安卓工作室 0.5.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Android 中设置谷歌地图 v2.我正在使用使用此链接添加依赖项的新技术."Android Studio with Google Play Services"

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"

同步、清理项目和重建项目后效果很好.但是我找不到 MapActivity.似乎是什么问题?

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

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'
}

推荐答案

MapActivity 是 Google Maps Android v1 API 的一部分,现已弃用.

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

使用 Google Play 服务库,您将使用 Google Maps Android API v2,然后 MapActivity 不再可用.您需要使用MapFragment.

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.

您可以在官方文档中查看如何使用MapFragment的介绍一>.

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

这篇关于找不到 MapActivity.安卓工作室 0.5.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆