[[15.0.1,15.0.1]] 的各种其他库正在请求库 com.google.android.gms:play-se

The library com.google.android.gms:play-services-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1([[15.0.1,15.0.1]] 的各种其他库正在请求库 com.google.android.gms:play-services-base,但解析为 16
本文介绍了[[15.0.1,15.0.1]] 的各种其他库正在请求库 com.google.android.gms:play-services-base,但解析为 16.0.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我发现这显然是一个常见问题,但发布的解决方案都不适用于我.我检查过,我所有的播放服务和 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
}

我也尝试过注释掉依赖关系,我得到一个不同的错误 (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 服务版本降级到 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

这篇关于[[15.0.1,15.0.1]] 的各种其他库正在请求库 com.google.android.gms:play-services-base,但解析为 16.0.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)