Gradle同步失败-其他各种库正在请求com.google.android.gms:play-services-basement

时间:2018-09-30 04:54:10

标签: android firebase dependencies

其他各种库都在[[11.0.1,11.0.1],[15.0.1,15.0.1]]请求库com.google.android.gms:play-services-basement ,但解析为15.0.1。禁用插件,并使用./gradlew:app:dependencies检查您的依赖关系树。

当我尝试在我的android项目上添加Firebase时,出现了此错误。我已经尽了一切可能解决该错误,但是我仍然遇到此错误。请给我一些解决该问题的建议。

应用程序级别依赖性

   repositories {
        maven {
            url "http://dl.bintray.com/lukaville/maven"
        }
    }
    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        //noinspection GradleCompatible
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:cardview-v7:27.1.1'
        implementation 'com.android.support:recyclerview-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        implementation 'com.android.support:design:27.1.1'
        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'
        implementation 'de.hdodenhof:circleimageview:2.1.0'
        implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.4'
        implementation 'com.facebook.android:facebook-login:4.28.0'
        implementation 'com.facebook.android:account-kit-sdk:4.28.0'
        implementation 'com.facebook.android:facebook-android-sdk:4.28.0'
        implementation 'com.miguelcatalan:materialsearchview:1.4.0'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.android.support:support-v4:27.1.1'
        implementation 'com.google.android.gms:play-services-auth:16.0.0'
        implementation 'com.google.android.gms:play-services-ads:15.0.1'
        //noinspection GradleCompatible
        implementation 'com.borjabravo:readmoretextview:2.0.1'
        implementation 'com.gmail.samehadar:iosdialog:1.0'
        implementation 'com.gdacciaro:iosdialog:1.0.3'
        implementation 'com.wdullaer:materialdatetimepicker:3.6.0'
        implementation 'com.bignerdranch.android:recyclerview-multiselect:0.2'
        implementation 'com.wrapp.floatlabelededittext:library:0.0.6'
        implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
        implementation 'com.android.volley:volley:1.1.0'
        implementation 'com.android.support:recyclerview-v7:27.1.1'
        implementation 'com.github.bumptech.glide:glide:4.7.1'
        implementation 'com.squareup.okhttp3:okhttp:3.10.0'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
        implementation 'com.google.code.gson:gson:2.8.2'
        implementation 'com.ms-square:expandableTextView:0.1.4'
        implementation 'com.nbsp:library:1.8'
        implementation 'net.gotev:uploadservice:2.1'
        implementation 'javax.mail:javax.mail-api:1.5.3'

        implementation 'com.google.firebase:firebase-core:16.0.3'

        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'
    }
    apply plugin: 'com.google.gms.google-services'

项目级别依赖性

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

1 个答案:

答案 0 :(得分:1)

我不确定这个问题的根本原因(可能是一些黑魔法)。 添加:

import com.google.gms.googleservices.GoogleServicesPlugin
GoogleServicesPlugin.config.disableVersionCheck = true

到应用程序级别的build.gradle文件。

从以下方面获取建议: https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/37

我很不明白我这样做的原因。但这可能会有帮助。