問題描述
我發(fā)現(xiàn)這顯然是一個常見問題,但發(fā)布的解決方案都不適用于我.我檢查過,我所有的播放服務(wù)和 firebase 庫都是最新版本.
I see that this is a common issue apparently, but none of the posted solutions work for me. I have checked and all of my play services and firebase libraries are at the latest version.
app/build.gradle
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "jobquals"
minSdkVersion 22
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
//com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
apply plugin: 'com.google.gms.google-services'
build.gradle
項目:
build.gradle
project:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我也嘗試過注釋掉依賴關(guān)系,我得到一個不同的錯誤 (Unexpected end of ZLIB input stream)
I have tried commenting out the dependencies as well, and I get a different error (Unexpected end of ZLIB input stream)
推薦答案
選項1
將您的 google 服務(wù)版本降級到 3.2.1
Downgrade your google service version to 3.2.1
classpath 'com.google.gms:google-services:3.2.1'
選項 2
就在 apply plugin: 'com.google.gms.google-services'
在您的 build.gradle
底部之后,可以添加以下解決方法問題.
right after the apply plugin: 'com.google.gms.google-services'
at the bottom of your build.gradle
the following can be added to work around the issue.
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
這篇關(guān)于[[15.0.1,15.0.1]] 的各種其他庫正在請求庫 com.google.android.gms:play-services-base,但解析為 16.0.1的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!