Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter build failed. Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath

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
}
like image 556
geekymano Avatar asked Apr 07 '19 06:04

geekymano


3 Answers

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

like image 125
flutter Avatar answered Oct 23 '22 15:10

flutter


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

like image 8
Googlian Avatar answered Oct 23 '22 16:10

Googlian


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.

like image 1
Nuwantha Fernando Avatar answered Oct 23 '22 15:10

Nuwantha Fernando