0
votes

this is my Error poping out and whole project depends on this

this is my Error poping out and whole project depends on this

My Gradle code is given below

 apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.github.ben-manes.versions'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.Safeer.Ahmad.MusicXtreme"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 34
        versionName "1.1.0"
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
    }

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.android.support:appcompat-v7:24.0.0'
  //  compile 'com.android.support:appcompat-v7:+'
//    compile 'com.android.support:support-v7:+'
    compile 'com.github.mmin18:realtimeblurview:1.1.0'
    compile 'jp.wasabeef:recyclerview-animators:2.2.5'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.squareup.okhttp3:okhttp:3.5.0'
    compile 'com.squareup.okhttp3:okhttp-urlconnection:3.5.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'bz.tsung.android:objectify:1.1.1'
    compile 'com.android.support:cardview-v7:25.2.0'
    compile 'com.android.support:palette-v7:25.2.0'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.diogobernardino:williamchart:2.3.0'
    compile 'tyrantgit:explosionfield:1.0.1'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:0.7.0'
    compile 'me.priyesh:chroma:1.0.2'
    compile 'com.github.QuadFlask:colorpicker:0.0.12'
    compile 'com.github.amlcurran.showcaseview:library:5.4.3'
    compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
    compile 'com.lantouzi.wheelview:library:1.1.2'
    compile 'jp.wasabeef:blurry:2.1.0'
    testCompile 'junit:junit:4.12'
    testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
    releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}

see it again

How did this error happens? i updated android studio and gradle and build tools as i want everything latest and this error pops out and i've tried every possible thing to solve it but failed. Just this error is unsolved rest my app is ready.

Current gradle is 3.3 and android studio is 2.3.1 with latest 26 support library appcompat

4
change this compile 'com.android.support:appcompat-v7:24.0.0' to compile 'com.android.support:appcompat-v7:25.2.0' - Uday Naidu
i have tried it buth nothing :( - Safeer Ahmad
Maybe this library is causing the issue because it uses old version of support library compile 'jp.wasabeef:recyclerview-animators:2.2.5' - Uday Naidu
The root of errors is from Android support library thing.. v7.. nothing is fixing this creepy error :( Tried your way but still nothing - Safeer Ahmad
You have not added support v7 lib? - Uday Naidu

4 Answers

1
votes

You get this error because you declared different versions of the support library for different modules. For example:

compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:25.2.0'

First, you need to change these to the same version. I have found that it is easier to keep version numbers in sync by adding a visible to the project's ext block. If I have time I'll add a link here. In the meantime, you should do some research.

I am not sure where the compile gets version 25.0.2 since you do not seem to declared this explicitly. It is possible that one of your other dependencies uses a that version of the support library.

0
votes

[Updated] Replace your dependencies with below code and check if its working or not

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true;
}
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:renderscript:25.2.0'
compile 'com.github.mmin18:realtimeblurview:1.1.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.5'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.5.0'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.5.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'bz.tsung.android:objectify:1.1.1'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:recycler-v7:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
compile 'com.wang.avi:library:2.1.3'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.diogobernardino:williamchart:2.3.0'
compile 'tyrantgit:explosionfield:1.0.1'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:0.7.0'
compile 'me.priyesh:chroma:1.0.2'
compile 'com.github.QuadFlask:colorpicker:0.0.12'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
compile 'com.lantouzi.wheelview:library:1.1.2'
compile 'jp.wasabeef:blurry:2.1.0'
testCompile 'junit:junit:4.12'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}
-1
votes

Update the appcompat-v7 line. The latest appcompat version is

compile 'com.android.support:appcompat-v7:25.3.1'

If updating all your dependencies to 25.3.1 doesn't work, click "Analyze" -> "Analyze dependencies..." in Android Studio and update your question with the output.

-1
votes

The problem lies in the version specified in your gradle files, like lets say, package x as dependency version1 and package k as same dependency version 1.5, gradle will throw that error. Consider using the exclude keyword to exclude a version dependency and set a shared one.

Also though not recommended instead of specifying the exact versions, replace the versions with a +.Example replace all seeded numbers with,

 compile 'com.android.support:appcompat-v7:+'

Make sense?