FAILURE: 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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
BUILD FAILED in 5s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
*******************************************************************************************
Finished with error:
Gradle task assembleDebug failed with exit code 1
Asked
Active
Viewed 391 times
-1

shizhen
- 12,251
- 9
- 52
- 88

Vivek Shetty
- 38
- 6
1 Answers
0
Try below inside your build.gradle
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { it ->
if (it.requested.group == 'androidx.appcompat'
&& !it.requested.name.contains('appcompat') ) {
it.useVersion "1.0.2"
}
}
}
}
Or
Change androidx.appcompat:appcompat
to version 1.0.2 inside your dependencies {}
block.

shizhen
- 12,251
- 9
- 52
- 88