1

I added a new dependency

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

but after synchronization build, I have an error

"Conflict with dependency com.android.support:support-annotations'"

here is my 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'

}

a screenshot on the error message

Thank you.

Bassem Jlassi
  • 187
  • 5
  • 11

2 Answers2

0

Use this into your build.gradle(app) file as top level.

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

like:

apply plugin: 'com.android.application'

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

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

dependencies {
    ........
    .......
}
Ghulam Moinul Quadir
  • 1,638
  • 1
  • 12
  • 17
0

add android test dependency

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

and replace compile with implementation

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

because the compile configuration is now deprecated and should be replaced by implementation or api for more info about read this answer

Upendra Shah
  • 2,218
  • 17
  • 27