Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency 'android.arch.core:runtime' has different version for the compile and runtime classpath

I converted a project to a library, then i used it in an other project, but the problem is when i try to call it with this in gradle : implementation project(':library'), i got this error :

Android dependency 'android.arch.core:runtime' has different version for the compile (1.1.0) and runtime (1.1.1) classpath.
You should manually set the same version via DependencyResolution
.
and i have so many dependencies in both.

my app gradle :

android {
   compileSdkVersion 28
   buildToolsVersion '28.0.2'
     defaultConfig {
    applicationId "com.free.caller"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    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:appcompat-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation 'com.android.support:cardview-v7:27.1.1'

implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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.android.support:multidex:1.0.3'
implementation 'com.google.android.gms:play-services-ads:16.0.0'


implementation 'com.github.satyan:sugar:1.5'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.wang.avi:library:2.1.3'


implementation('com.github.alex31n:andutils:1.0.4') {
    transitive = false
}
implementation('com.ornach.bitpermission:bit-permission:1.1') {
    transitive = false
}
implementation('com.ornach.nobobutton:nobobutton:1.6') {
    transitive = false
}
implementation('com.ornach.magicicon:magic-icon:1.6') {
    transitive = false
}
implementation('com.ornach.richtext:richtext:1.0') {
    transitive = false
}
implementation 'com.github.GrenderG:Toasty:1.3.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'com.github.florent37:expansionpanel:1.1.1'

implementation 'com.github.bumptech.glide:glide:3.7.0'

  //// ----  when i call it, the error showed up
implementation project(':library')

}

my library gradle :

android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {

    minSdkVersion 16
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true

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


}

lintOptions {
    checkReleaseBuilds false
    abortOnError false
}
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2') {
    exclude module: 'support-annotations'
}

implementation 'com.github.TeamNewPipe:NewPipeExtractor:217d13b1028'

testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.8.9'

implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.android.support:support-v4:27.1.1"
implementation "com.android.support:design:27.1.1"
implementation "com.android.support:recyclerview-v7:27.1.1"
implementation "com.android.support:preference-v14:27.1.1"
implementation 'com.android.support:cardview-v7:27.1.1'


implementation 'ch.acra:acra:4.9.2'

implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.nirhart:ParallaxScroll:dd53d1f9d1'
implementation 'com.nononsenseapps:filepicker:4.2.1'

implementation "com.google.android.exoplayer:exoplayer:2.8.2"
implementation "com.google.android.exoplayer:extension-mediasession:2.8.2"

debugImplementation "com.facebook.stetho:stetho:1.5.0"
debugImplementation "com.facebook.stetho:stetho-urlconnection:1.5.0"
debugImplementation 'com.android.support:multidex:1.0.3'

implementation 'io.reactivex.rxjava2:rxjava:2.1.14'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'

implementation "android.arch.persistence.room:runtime:1.1.1"
implementation "android.arch.persistence.room:rxjava2:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"

implementation "frankiesardo:icepick:3.2.0"
annotationProcessor "frankiesardo:icepick-processor:3.2.0"

debugImplementation "com.squareup.leakcanary:leakcanary-android:1.5.4"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:1.5.4"

implementation "com.squareup.okhttp3:okhttp:3.10.0"
debugImplementation "com.facebook.stetho:stetho-okhttp3:1.5.0"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
}

i think all what causes this problem is these lines :

implementation "android.arch.persistence.room:runtime:1.1.1"
implementation "android.arch.persistence.room:rxjava2:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"
like image 292
Krova Avatar asked Mar 30 '26 01:03

Krova


1 Answers

I've face up the same issue , so I solved it updating of google-services

classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.google.gms:google-services:4.2.0'

Ps, If update gradle to 3.3.0 or higher, shows error , it was my case, so I decided to set gradle like this then it works perfectly!!

like image 178
Liliana J Avatar answered Apr 02 '26 10:04

Liliana J



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!