13

I am trying to build my flutter app but it gives this error:

Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath. You should manually set the same version via DependencyResolution

here is my android/build.gradle file:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
    project.configurations.all {
    resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "28.0.0"
            }
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

3 Answers 3

33

try upgrading the gradle dependency: classpath from 'com.android.tools.build:gradle:3.2.1' to 'com.android.tools.build:gradle:3.3.1'

Sign up to request clarification or add additional context in comments.

3 Comments

it is now returning this error: Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. I think I should use this solution stackoverflow.com/questions/54851489/… what do you think?
this answer stackoverflow.com/questions/54851489/… solved my problem
8

Change versions in your project level build.gradle file

kotlin_version - 1.3.0

com.android.tools.build:gradle:3.3.2 version - 3.3.2

com.google.gms:google-services:4.3.2 version - 4.3.2

Comments

1

Change versions in your project level build.gradle file

Update kotlin_version, com.android.tools.build:gradle:, com.google.gms:google-services: to the latest versions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.