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
}
geekymano
  • 1,420
  • 5
  • 22
  • 53

3 Answers3

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'

flutter
  • 6,188
  • 9
  • 45
  • 78
  • 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 https://stackoverflow.com/questions/54851489/flutter-projects-android-x-migration-issues what do you think? – geekymano Apr 07 '19 at 08:12
  • 2
    this answer https://stackoverflow.com/questions/54851489/flutter-projects-android-x-migration-issues solved my problem – geekymano Apr 07 '19 at 08:28
  • 1
    For Flutter users, https://github.com/flutter/flutter/issues/27254#issuecomment-477474444 helped me – Kishan Solanki Oct 14 '19 at 09:39
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

Googlian
  • 6,077
  • 3
  • 38
  • 44
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.

Sabith
  • 1,628
  • 2
  • 20
  • 38