【发布时间】:2016-09-13 13:09:54
【问题描述】:
当我在 android mobile 版本 4.4 (lollipop) 上部署我的 android 应用程序时,我收到一条消息“除非您更新 Google Play 服务,否则应用程序将无法运行”
我查看了我的 android 手机,可以看到 Google Play 服务版本是 5.1.89。我知道在我的代码中我使用的是 8.4.0
我不希望 android 向用户显示弹出窗口以更新 google play 服务
任何 android 移动应用专家都可以帮我解决这个问题。 如何在不要求用户更新谷歌服务的情况下使我的应用向后兼容?
我的build.gradle如下
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildTypes {
debug {
debuggable true
}
}
defaultConfig {
applicationId "com.me"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
}
【问题讨论】:
-
这是不可避免的。否则降级你的版本,虽然这会牺牲一些功能并且那些旧的错误会再次出现。
-
尝试在您的
build.gradle中添加compile 'com.google.android.gms:play-services:5.0.+' -
如果我设置为 5.0.+,我的应用程序是否可以在带有 Google 服务 8.4.0 的 Marshmallow 版本的 Android 手机上运行?
-
嗨 Enzokie,如果我降级,我的应用会在 8.4.+ 的 google play services 的更高版本的 android 上运行吗?
-
嗨 Indramurari,我尝试使用 5.0.+ 进行编译,但出现错误。我看起来需要提供正确的版本名称,例如 5.0.89 。当我查看 /m2repository/ 时,我的计算机中没有 5.0.89 版本。如何下载 google play 5.0.89
标签: android android-gradle-plugin google-play-services google-maps-android-api-2 mobile-application