【问题标题】:“App won't run unless you update Google Play services” with Google Maps API android studio使用 Google Maps API android studio “除非您更新 Google Play 服务,否则应用程序将无法运行”
【发布时间】:2016-03-23 14:42:39
【问题描述】:

我正在尝试在 android 中制作谷歌地图应用程序。我已经在 SDK 管理器中安装了 Google Play 服务。当我运行该应用程序时,模拟器中有错误文本:

除非您更新 Google Play 服务,否则应用将无法运行

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "ge.currencyexchange"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:8.3.0'
}

我尝试将 compile 'com.google.android.gms:play-services:8.3.0' 更改为 compile 'com.google.android.gms:play-services:5.0.+',但调试后它会引发有关主题的错误,并且在 AVD 中一切都相同

我能做什么?

【问题讨论】:

  • 好的。设置minSdkVersion 15
  • @IntelliJAmiya 结果是一样的..
  • 你的classpath是什么
  • 该消息的意思是,模拟器中安装的Google play服务太旧了。尝试为模拟器使用更新的图像。
  • @IntelliJAmiya 在 7.8.0 上工作,非常感谢

标签: java android google-maps android-studio


【解决方案1】:

使用compile 'com.google.android.gms:play-services:7.8.0' 而不是compile 'com.google.android.gms:play-services:8.3.0'

终于

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:7.8.0'
}

【讨论】:

    【解决方案2】:

    错误表明您需要在您的设备上更新 Google Play 服务,即模拟器。当设备上安装的 Play Services 与您的应用程序所需的 Play Services 不匹配(或根本未安装)时,将引发此错误。
    打开 Play 市场,找到 Google Play 服务并点击Update。如果您使用 Genymotion,建议您阅读this 的答案。

    【讨论】:

    • 我有最新的 Google Play 服务,我的模拟器在 nexus 5 上。我在 android studio 上使用 API 23。所以..
    猜你喜欢
    • 2013-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-23
    • 2017-12-08
    • 2015-08-22
    相关资源
    最近更新 更多