0

I'm trying to run a BackgroundTask on my application in order to control my audio player. To achieve this, I want to use the audio_service package.

But, when I just import it in my pubspec.yaml, my whole project crash and is impossible to run again.

This is the error :


FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:checkDebugDuplicateClasses'.

1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

Go to the documentation to learn how to Fix dependency resolution errors.


I tried with a brand new project to see if it's a conflict inner my packages. But, even without any packages, I'm front of this error.

Is there a problem with that package, or someone who has already encountered this error?

Thanks a lot.

rigorousCode
  • 385
  • 1
  • 2
  • 9

1 Answers1

1

This (from Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0)) worked for me:

Add the line

implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

to the dependencies block in your app/src/build.gradle file.