【发布时间】:2016-12-04 18:34:18
【问题描述】:
我正在尝试使用 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'
}
【问题讨论】: