我正在尝试使用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'
}