Android Studio 2.1.2与Firebase不工作 [英] Android Studio 2.1.2 with Firebase NOT WORKING
问题描述
W / GooglePlayServicesUtil:Google Play服务已过时。需要11020000,但找到8489470
W / FA:服务连接失败:ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null,message = null}
E / FA:丢弃数据。 E / FA:无法获取应用程序实例ID
E / FA:无法将当前屏幕发送至服务
E / FA:丢弃数据。无法将事件发送到服务
我得到的是与Google Play服务相关的内容,但我无法弄清楚如何解决这个问题,我正在运行Android Studio 2.1.2,并且SDK中没有针对Google Play服务的更新
编辑:我的应用程序Gradle一个模拟器)
apply plugin:'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion26.0.0
defaultConfig {
applicationIdcom.example.sc.voxcinemascamp
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt' ),'proguard-rules.pro'
}
}
}
依赖关系{
编译fileTree(dir:'libs',i nclude:['* .jar'])
testCompile'junit:junit:4.12'
compile'com.android.support:appcompat-v7:26.0.0-alpha1'
compile' com.google.firebase:firebase-core:11.0.2'
}
应用插件:'com.google.gms.google-services'
现在很清楚。您需要更新您的模拟器来安装Play Services 11,或者将您的Firebase依赖关系降级为与您的模拟器上安装的Google Play Services相匹配。
我宁愿建议更新模拟器,请勿降级由于模拟器而在您的应用中使用的Play服务。
whenever I try initiating firebase, there's always these errors
W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 8489470
W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
E/FA: Discarding data. Failed to send app launch
E/FA: Failed to get app instance id
E/FA: Failed to send current screen to service
E/FA: Discarding data. Failed to send event to service
I get it's something related to Google Play Services but I just cant figure out how to fix it, I'm running Android Studio 2.1.2 and there's no update for Google Play Services in the SDKs
EDIT: My App Gradle (I'm using an emulator)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.sc.voxcinemascamp"
minSdkVersion 15
targetSdkVersion 26
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:26.0.0-alpha1'
compile 'com.google.firebase:firebase-core:11.0.2'
}
apply plugin: 'com.google.gms.google-services'
So, it's clear now. You need either update your emulator to get Play Services 11 installed on it, or downgrade your firebase dependency to match Google Play Services installed on your emulator.
I would rather suggest to update emulator, don't downgrade Play Services used in your app because of emulator.
这篇关于Android Studio 2.1.2与Firebase不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!