Tau: [BUG]: Build failed Android with FFMpeg

Created on 18 Jul 2021  路  6Comments  路  Source: Canardoux/tau

Flutter Sound Version :

flutter_sound: 8.2.0

  • Important: Result of the command : flutter pub deps | grep flutter_sound
|-- flutter_sound 8.2.0
|   |-- flutter_sound_platform_interface 8.2.0
|   |-- flutter_sound_web 8.2.0
|   |   |-- flutter_sound_platform_interface...

Severity

  • Cannot build my App

Platforms you faced the error

  • Android
  • Real device

Describe the bug
Build failed due to duplicate FFMPEG classes. There is a conflict between flutter_ffmpeg and flutter_sound
That makes flutter_sound unsable if we use flutter_ffmpeg in our project
I am making an issue here as ffmpeg doesn't seem to be depending on any other package and is "lower level" API that maybe flutter_sound is also using.

To Reproduce
Steps to reproduce the behavior:

  1. Add the flutter_ffmpeg package to the latest version (0.4.0 at the time of this issue)
  2. Add flutter_sound: ^8.2.0
  3. Build the application on a real Android device

Logs

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.arthenica.mobileffmpeg.Abi found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.AbiDetect found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.AsyncFFmpegExecuteTask found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.AsyncFFprobeExecuteTask found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.AsyncGetMediaInformationTask found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.BuildConfig found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.CameraSupport found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Config found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Config$1 found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.ExecuteCallback found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.FFmpeg found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.FFmpegExecution found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.FFprobe found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.GetMediaInformationCallback found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Level found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.LogCallback found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.LogMessage found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.MediaInformation found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.MediaInformationParser found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Packages found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Signal found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.Statistics found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.StatisticsCallback found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.StreamInformation found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.util.Pair found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)
     Duplicate class com.arthenica.mobileffmpeg.util.Trio found in modules jetified-mobile-ffmpeg-full-4.4.LTS-runtime (com.arthenica:mobile-ffmpeg-full:4.4.LTS) and jetified-mobile-ffmpeg-https-4.4-runtime (com.arthenica:mobile-ffmpeg-https:4.4)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* 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 48s
Exception: Gradle task assembleDebug failed with exit code 1

maybe bug Not yet handled

Most helpful comment

flutter_sound includes ffmpeg for some conversion methods between different codecs which you can use yourself, and this also allows it to support more codecs. See here: https://tau.canardoux.xyz/guides_codec.html

All 6 comments

Use flutter_sound_lite which does not include ffmpeg

Thanks for your reply and suggestion, indeed it's now working !
However, where can i find the differences between the full and the lite version please ?

flutter_sound includes ffmpeg for some conversion methods between different codecs which you can use yourself, and this also allows it to support more codecs. See here: https://tau.canardoux.xyz/guides_codec.html

Actually, the only difference between the LITE flavor and the FULL flavor is only the inclusion of Mobile FFmpeg in the FULL version.
It is possible in the future that there will be some other differences, but actually this is only that.

The big reason of the FULL flavor, is to be able to play regular OPUS/OGG files on iOS.
Apple people are so stupids that their implementation of the OPUS codec use a proprietary File Format that is CAF instead of a normal OGG.
I really wanted Flutter Sound being able to play directely OPUS/OGG without having the App to do itself the conversion.

Also, one of my many projects will be to be able to record MP3 on the flight, without having to convert the file after recording.
To do that, I will use LAME, which is a free MP3 encoder and is part of FlutterFFmpeg.

Please re-open this issue if you have still problems

Was this page helpful?
0 / 5 - 0 ratings