android - 旧设备问题上的 google play 服务和 firebase 应用程序

标签 android firebase google-play-services

我有一个具有以下依赖项的 Firebase 应用

// Play Services
    compile 'com.google.android.gms:play-services:9.0.2'
    compile 'com.google.android.gms:play-services-base:9.0.2'
    compile 'com.google.android.gms:play-services-auth:9.0.2'
    compile 'com.google.android.gms:play-services-location:9.0.2'

    // Firebase
    compile 'com.firebaseui:firebase-ui-database:0.4.0'
    compile 'com.google.firebase:firebase-storage:9.0.2'
    compile 'com.google.firebase:firebase-common:9.0.2'
    compile 'com.google.firebase:firebase-auth:9.0.2'
    compile 'com.google.firebase:firebase-database:9.0.2'
    compile 'com.google.firebase:firebase-crash:9.0.2'
    compile 'com.google.firebase:firebase-core:9.0.2'
    compile 'com.google.firebase:firebase-messaging:9.0.2'

当我在 OS 4.4.2 上运行该应用程序时,由于应用程序无法运行而出现错误,我发现这是 com.google.android.gms 播放服务的问题我安装了 com.google.android.gms 9.4.xx 我遇到了错误This app requires newer Virson of OS

问题:我是否应该使用任何设置/依赖项,以便我的 Firebase 也能在旧设备上运行,请在这种情况下提供帮助!

最佳答案

@疯狂程序员

只是想确认您的 API 级别 17 的设备是否安装了 Google Play 服务?如果没有,则必须在您的设备上安装 Google Play 服务才能使其正常工作。

另请注意,您的 Google Play 服务应为 9.4.0 或更高版本。

希望对您有所帮助。如果您还有其他疑虑,请告诉我

http://i.stack.imgur.com/2s5h5.png

这是我的应用级 gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.app.ids"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    useLibrary 'org.apache.http.legacy'
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),   'proguard-rules.pro'
    }
    }
    }
   dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'
compile 'com.squareup.picasso:picasso:2.5.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile fileTree(include: '*.jar', dir: 'libs')
compile files('libs/ksoap2-android-assembly-2.4-jar-with-dependencies.jar')
compile 'com.android.support:multidex:1.0.0'
compile 'com.github.oliveiradev:image-zoom:0.1.0'
compile 'it.sephiroth.android.library.imagezoom:imagezoom:+'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-core:9.2.1'
compile 'com.google.firebase:firebase-messaging:9.2.1'
compile 'com.firebase:firebase-client-android:2.5.1+'
}
apply plugin: 'com.google.gms.google-services'

这是我的项目级 gradle 文件:

  buildscript {
  repositories {
    jcenter()
   }
   dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:1.5.0-beta2'
    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
    classpath 'com.google.gms:google-services:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }
  }
  allprojects {
  repositories {
    jcenter()
    maven { url "https://jitpack.io" }
  }
  }
  task clean(type: Delete) {
  delete rootProject.buildDir
   }

关于android - 旧设备问题上的 google play 服务和 firebase 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38887073/

相关文章:

android: jetpack compose lazycolumn

firebase - Firebase 安全规则可以用于提供正确的数据还是仅适用于恶意用户?

java - 删除Google Play游戏数据后卡住,无法登录

java - libGDX:我如何告诉核心游戏 getIconImageUri() 并将其用作我的游戏中的图像 Actor

android - 当我同步我的项目然后告诉我(任务 ':app:processDebugGoogleServices' 执行失败)但我添加了 google-services.json

android - 在给定时间以编程方式暂停/停止 MediaPlayer Android

Android 资源限定符 -sw#dp 与 -w#dp

javascript - Firestore "set"和文档的最大写入速率

firebase - firebase 是否提供任何形式的测试 token ?

Android/iOS 测试自动化 : How to simulate complex gestures