ZieIony / Carbon

Material Design implementation for Android 4.0+. Shadows, ripples, vectors, fonts, animations, widgets, rounded corners and more.

Home Page:https://androidreclib.wordpress.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android dependency 'com.android.support.constraint:constraint-layout' has different version for the compile (1.0.2) and runtime (1.1.0) classpath. You should manually set the same version via DependencyResolution

SephirothLT opened this issue · comments

Android dependency 'com.android.support.constraint:constraint-layout' has different version for the compile (1.0.2) and runtime (1.1.0) classpath. You should manually set the same version via DependencyResolution

@ZieIony I find this problem why occur this

allprojects {
    addRepos(repositories)
    // Android dependency 'com.android.support:design' has different version for the compile (25.3.1) and runtime (25.4.0) classpath.
    // You should manually set the same version via DependencyResolution
    subprojects {
        project.configurations.all {
          
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support.constraint:constraint-layout'
                        && !details.requested.name.contains('multidex')) {
                    details.useVersion  "1.1.0"
                }
            }
        }

    }

Solve this problem , But another problem occured!

invokedynamic requires --min-sdk-version >= 26

I had add this to build

   compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

Your first issue is very common for Android projects. I believe that there's a couple of methods to solve it.

The requirement for Java 8 is mentioned in the installation guide.

image
I had added this to build,It doesn't work

@ZieIony I cleaned the project and rebuild project,but doesn't work

What do you mean by "doesn't work"? Do you have any logs I could see? I'm not sure, which of the issues are you currently struggling with.

Here is my build file

apply plugin: 'com.android.library'
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
    compileSdkVersion build_versions.target_sdk
    defaultConfig {
        minSdkVersion build_versions.min_sdk
        targetSdkVersion build_versions.target_sdk
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        //svg兼容低版本
        vectorDrawables.useSupportLibrary = true

        ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildTypes {
        release {
            buildConfigField "boolean", "LOG_DEBUG", "true"
            zipAlignEnabled false
            shrinkResources false
            minifyEnabled false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'lib/x86_64/darwin/libscrypt.dylib'
        exclude 'lib/x86_64/freebsd/libscrypt.so'
        exclude 'lib/x86_64/linux/libscrypt.so'
    }
    dataBinding {
        enabled = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}




dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    // Support libraries
    compile deps.support.app_compat
    compile deps.support.v4
    compile deps.support.design
    compile deps.support.cardview
    compile deps.support.recyclerview
    compile deps.support.multidex
    // RxJava and retrofit
    compile deps.rx_android
    compile deps.retrofit.runtime
    compile deps.retrofit.gson
    compile deps.retrofit.adapter
    //Dagger
    compile deps.dagger.runtime
    // other
    compile deps.greendao.runtime
    compile deps.kotlin.stdlib
    compile deps.event_bus
    compile deps.gson
    compile deps.permission
    compile deps.glide
    compile deps.butterknife.runtime
    compile deps.percent
    compile deps.rxlifecycle.runtime
    compile deps.rxlifecycle.components
    compile deps.lottie
    compile deps.tinypinyin
    compile deps.web3j
    compile deps.bitcoinj
    compile deps.fingerprintidentify
    compile deps.mobstat
    compile deps.adapter_helper
    compile deps.mobstat
    //router
    compile deps.arouter_api
    //annotationProcessor
    annotationProcessor deps.dagger.compiler
    compile project(path: ':lib-zxing')
    compile project(':neoutils')
    compile 'com.github.kotlin-graphics:kotlin-unsigned:v2.1'
    //UnsignedByte
    compile 'com.github.kittinunf.fuel:fuel:+'
    compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
    compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    compile 'com.robinhood.ticker:ticker:1.2.2'
    compile 'com.squareup.okhttp3:logging-interceptor:3.10.0'
    compile 'com.hbb20:ccp:2.2.0'
    compile 'com.github.385841539:MarqueeView:1.0.0'
    implementation 'tk.zielony:carbon:0.15.0.1'


    //    compile 'xyz.belvi.validator:phonenumbervalidator:1.0.0'
    //    compile 'com.github.Willena:Android_PhoneNumber_Input:1.0'
    implementation files('libs/tbs_sdk_thirdapp_v3.6.0.1183_43604_sharewithdownload_withoutGame_obfs_20180211_105126.jar')
    implementation files('libs/libphonenumber-8.9.7-javadoc.jar')
}

image

Seems like you need to implement Carbon's dependency using the latest of their version. Got the same problem, but issue #320 's solution fixed it for me.

Try adding these in the beginning of your dependencies:

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})

Thanks ! I will try it

Please don't close issues without a comment in other's projects. Were you able to solve your problem? What was it? What is the solution? It may be helpful for other users.

No answer for a week, I'm closing this issue.