'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.



Solution 1:[1]

Clean the project: flutter clean Upgrade dependencies: flutter pub upgrade --major-versions Run the app. Let me know if you still had problem using those packages.

Update: this seems to be a problem with audio_manager. try using audio_service: ^0.18.3 instead. audio_service

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1