Launching lib\main.dart on Nokia X6 in debug mode...
Initializing gradle...
Resolving dependencies...
Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
&> Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (27.1.1) 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 14s
Finished with error: Gradle task assembleDebug failed with exit code 1
How to Solve:
Add a new line in android/app/build.gradle,dependencies
dependencies {
//PART TO ADD
implementation "com.android.support:support-v4:27.1.1"
}
There is another way online:
subprojects {
project.evaluationDependsOn(':app')
//[PART TO ADD START]
project.configurations.all {
resolutionStrategy.eachDependency { details -&>
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.0"
}
}
}
//[PART TO ADD END]
}
Similar Posts:
- [Solved] Android Studio Conflict with dependency ‘com.android.support:support-annotations’
- To solve the version compatibility problem of support library: the support package has a red underline when it is introduced
- [Solved] Android Bug: Error:com.android.dex.DexException: Multiple dex files define Landroid/support/design…
- Flutter run Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’
- About fluent reference image_ Error reported by picker plug-in
- Android Studio compilation: Program type already present: XXX solution
- Android ERROR: This version of Android Studio cannot open this project, please retry with Android Studio 3.6 or newer.
- AndroidStudio Error:Failed to resolve: com.android.support:appcompat-v7:29
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler