Android Google地图不起作用

时间:2016-12-04 18:34:18

标签: google-play-services

我正在尝试使用Google地图制作简单的应用。但是当我在模拟器中运行应用程序时,地图不会显示,只显示此文本:“除非您更新Google Play服务,否则”[应用程序名称]将无法运行“。我使用Nougat 7.1(使用Google API)安装了模拟器Nexus 5。我没有在谷歌上找到解决方案。我可以在模拟器上运行Google地图应用程序,还是必须在真实设备上进行测试?

更新:在build.gradle中:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
    applicationId "com.malikbisic.mapsdemo"
    minSdkVersion 21
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
testCompile 'junit:junit:4.12'
}

1 个答案:

答案 0 :(得分:0)

好吧,您可以使用模拟器运行它,但请确保您的Android模拟器使用AVD运行基于Android 4.2.2或更高版本的Google API平台。

检查此thread和此video,了解如何设置和使用Android模拟器来运行Google地图。