0

Build failed with an exception:

What went wrong: Execution failed for task ':app:preDebugBuild'. Android dependency 'androidx.appcompat:appcompat' has different version for the compile (1.0.1) and runtime (1.0.2) classpath. You should manually set the same version via DependencyResolution

 Doctor summary (to see all details, run flutter doctor -v):
 [√] Flutter (Channel beta, v1.1.8, on Microsoft Windows [Version 10.0.17763.292], locale en-US)
 [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
 [√] Android Studio (version 3.3)
 [√] IntelliJ IDEA Ultimate Edition (version 2018.2)
 [√] Connected device (2 available)
dpapadopoulos
  • 1,834
  • 5
  • 23
  • 34
Nate Z
  • 41
  • 4
  • This `stackoverflow` answer will be helpful as there are several heavily upvoted answers, which will give you many ways to solve your problem : [Android dependency has different version for the compile and runtime](https://stackoverflow.com/questions/44653261/android-dependency-has-different-version-for-the-compile-and-runtime) – Mazin Ibrahim Feb 15 '19 at 09:27

2 Answers2

0

Please try by Adding following code to your android/build.gradle file

subprojects {
    project.configurations.all {
    resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "28.0.0"
            }
        }
    }
}

Please let me know is it worked for you. This documentation will helps you

Hope this will helps you

Rahul Mahadik
  • 11,668
  • 6
  • 41
  • 54
0

just add below code in build.gradle

repositories { maven { url 'https://maven.google.com' } }  
AnAIDE
  • 21
  • 2