【问题标题】:Gradle sync fails - com.google.android.gms:play-services-basement is being requested by various other librariesGradle 同步失败 - com.google.android.gms:play-services-basement 正在被其他各种库请求
【发布时间】:2018-09-30 04:54:10
【问题描述】:

库 com.google.android.gms:play-services-basement 正在 [[11.0.1,11.0.1], [15.0.1,15.0.1]] 的各种其他库请求,但解析为 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()
    }
}

【问题讨论】:

  • 你说没有 Firebase 也可以,对吧?
  • 是的,没有 firebase 也可以使用

标签: android firebase dependencies


【解决方案1】:

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

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

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

听取以下意见: https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/37

我很沮丧,因为我不明白其中的原因。但它可能会有所帮助。

【讨论】:

  • 您好。如果平台文件没有检入版本控制系统,是否每个在该系统上工作的开发人员都必须手动执行此操作?
猜你喜欢
  • 1970-01-01
  • 2019-06-20
  • 1970-01-01
  • 2019-08-13
  • 1970-01-01
  • 2018-11-07
  • 2019-06-19
  • 2018-12-31
相关资源
最近更新 更多