Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - android - Execution failed for task ':app:checkDebugDuplicateClasses'

I am not able to use

flutter_html: ^2.2.1 

and

audio_manager: ^0.8.2 

in one project. It shows error

Execution failed for task ':app:checkDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.google.android.exoplayer2.ui.package-info found in modules jetified-exoplayer-common-2.14.1-runtime (com.google.android.exoplayer:exoplayer-common:2.14.1) and jetified-exoplayer-ui-2.11.1-runtime (com.google.android.exoplayer:exoplayer-ui:2.11.1)
Go to the documentation to learn how to Fix dependency resolution errors.

like image 214
Ankit Solanki Avatar asked Jun 19 '26 00:06

Ankit Solanki


1 Answers

I was able to fix the same error for another package, I will drop how I did it because it might help someone fix the issue.

I went to the file called settings.gradle it's at the Android directory level and I changed the current line from:

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

to this :

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.3.0" apply false
    id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

Basically the version

it seems that there was some sort of problem with different versions of Kotlin in my packages...

what I did next after saving the changes:

terminal commands:

flutter clean

flutter pub upgrade --major-versions

after this I uninstalled the app, closed my IDE (vscode), reopened it, and the app and package (share_plus) worked fine.

i hope this helps someone in the future, peace.

like image 111
rida brahim Avatar answered Jun 22 '26 13:06

rida brahim