Конфликт с зависимостью: build.gradle - PullRequest
0 голосов
/ 20 мая 2018

Я добавил новую зависимость

compile 'com.github.markomilos:paginate:0.5.1'

, но после сборки синхронизации у меня возникает ошибка

"Конфликт с зависимостью com.android.support:support-annotations '"

вот мой build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.formation.mvpnewproject"
        minSdkVersion 17
        targetSdkVersion 26
        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.constraint:constraint-layout:1.1.0'
    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 'com.google.code.gson:gson:2.8.1'

    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'

    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
    compile 'com.github.markomilos:paginate:0.5.1'

}

снимок экрана с сообщением об ошибке

Спасибо.

Ответы [ 2 ]

0 голосов
/ 20 мая 2018

добавить тестовую зависимость для Android

androidTestImplementation 'com.android.support:support-annotations:27.1.1'

и заменить компиляцию реализацией

implementation 'com.github.markomilos:paginate:0.5.1'

, поскольку конфигурация компиляции теперь устарела иследует заменить на реализацию или API для получения дополнительной информации о читать этот ответ

0 голосов
/ 20 мая 2018

Используйте это в файл build.gradle(app) в качестве верхнего уровня.

configurations.all {
    resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}

как:

apply plugin: 'com.android.application'

android {
    .......
    .......
}

configurations.all {
     resolutionStrategy.force 'com.android.support:support-annotations:23.0.1'
}

dependencies {
    ........
    .......
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...