Как устранить повторяющуюся ошибку класса в сборке Gradle? - PullRequest
1 голос
/ 07 мая 2019

Я пытался использовать ibm tone analyzer api для своего проекта, но если я включил зависимость, я получаю эту ошибку:

Дубликат класса javax.annotation.CheckForNull найден в модулях annotations-3.0.1.jar (com.google.code.findbugs: annotations: 3.0.1) и jsr305-3.0.2.jar (com.google.code.findbugs: jsr305: 3.0.2) Дубликат класс javax.annotation.CheckForSigned найден в модулях annotations-3.0.1.jar (com.google.code.findbugs: annotations: 3.0.1) и jsr305-3.0.2.jar (com.google.code.findbugs: jsr305: 3.0.2)

Я пытался удалить тестовые зависимости, но все равно не работает, пожалуйста, помогите

Файл приложения:

apply plugin: 'com.android.application'

android {
    configurations.all{

            resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.loginapp"
        minSdkVersion 22
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    compile 'com.ibm.watson:tone-analyzer:7.0.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude module: 'jsr305:3.0.2'

    })
    implementation 'com.google.firebase:firebase-auth:16.2.1'

}
// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services'  // Google Play services Gradle plugin

Файл сборки Gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()


    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath 'com.google.gms:google-services:4.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {

    repositories {

        maven {
            url  "https://dl.bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo"
        }

        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...