Gradle中的依赖关系失败基于我应用程序中没有的依赖关系

时间:2019-06-22 21:24:51

标签: android firebase gradle firebase-cloud-messaging

当我将implementation 'com.google.firebase:firebase-admin:6.8.1'添加到我的依赖项时,我的构建失败:

In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1.12.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: io.grpc:grpc-okhttp:1.12.0 -> io.grpc:grpc-core@[1.12.0], but grpc-core version was 1.13.1.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto io.grpc:grpc-stub@{strictly 1.13.1}
-- Project 'app' depends onto io.grpc:grpc-okhttp@{strictly 1.12.0}
-- Project 'app' depends onto com.google.cloud:google-cloud-core-grpc@{strictly 1.43.0}
-- Project 'app' depends onto io.grpc:grpc-auth@{strictly 1.13.1}
-- Project 'app' depends onto io.grpc:grpc-protobuf@{strictly 1.13.1}
-- Project 'app' depends onto io.grpc:grpc-protobuf-lite@{strictly 1.13.1}
-- Project 'app' depends onto com.google.firebase:firebase-admin@6.8.1
-- Project 'app' depends onto com.google.firebase:firebase-firestore@{strictly 17.1.2}
-- Project 'app' depends onto com.google.firebase:firebase-firestore@17.1.2
-- Project 'app' depends onto io.grpc:grpc-core@{strictly 1.13.1}
-- Project 'app' depends onto com.google.cloud:google-cloud-firestore@{strictly 0.61.0-beta}
-- Project 'app' depends onto com.google.firebase:firebase-admin@{strictly 6.8.1}
-- Project 'app' depends onto io.opencensus:opencensus-contrib-grpc-util@{strictly 0.15.0}
-- Project 'app' depends onto com.google.api:gax-grpc@{strictly 1.30.0}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.

但是我的gradle中没有任何okhttp / grpc依赖项:

build.gradle(应用程序)

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "app.zorgan"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 2
        versionName "1.1"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.google.firebase:firebase-storage:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
    implementation 'com.google.firebase:firebase-admin:6.8.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.facebook.android:facebook-android-sdk:5.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'androidx.viewpager2:viewpager2:1.0.0-alpha04'
    implementation 'androidx.preference:preference:1.1.0-alpha05'
    implementation 'androidx.preference:preference-ktx:1.1.0-alpha05'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    kapt 'com.github.bumptech.glide:compiler:4.9.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
}

build.gradle(项目)

buildscript {
    ext.kotlin_version = '1.3.21'
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

我已经搜索了整个项目目录,并且关键字grpcokhttp不存在。但是我确实在Android SDK代码中找到了实例:

enter image description here

这是否意味着构建工作的唯一方法是添加grpc / okhttp依赖项?这似乎不正确,因为Add the Firebase Admin SDK设置中没有提及此内容。

0 个答案:

没有答案