Android Studio 重复类我已经在代码中使用了ffmpeg_kit_flutter_audio:5.1.0-LTS用于音频转换视频编辑器:^2.1.0

p1iqtdky  于 2022-12-19  发布在  Android
关注(0)|答案(1)|浏览(336)

我已经在代码中使用了:ffmpeg_kit_flutter_audio-5.1.0-用于音频转换的LTS,当您将视频编辑器:^2.1.0一般性错误,有没有解决的方法?
失败:生成失败,出现异常。

  • 出了什么问题:任务":app:checkDebugDuplicateClasses"的执行失败。

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.arthenica.ffmpegkit.Abi found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.AbiDetect found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.AbstractSession found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.AsyncFFmpegExecuteTask found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.AsyncFFprobeExecuteTask found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.AsyncGetMediaInformationTask found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.BuildConfig found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.CameraSupport found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Chapter found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegKit found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegKitConfig found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegKitConfig$1 found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegKitConfig$2 found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegKitConfig$SAFProtocolUrl found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegSession found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFmpegSessionCompleteCallback found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFprobeKit found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFprobeSession found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.FFprobeSessionCompleteCallback found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Level found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Log found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.LogCallback found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.LogRedirectionStrategy found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.MediaInformation found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.MediaInformationJsonParser found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.MediaInformationSession found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.MediaInformationSessionCompleteCallback found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.NativeLoader found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Packages found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.ReturnCode found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Session found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.SessionState found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Signal found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.Statistics found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.StatisticsCallback found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1) Duplicate class com.arthenica.ffmpegkit.StreamInformation found in modules jetified-ffmpeg-kit-audio-5.1.LTS-runtime (com.arthenica:ffmpeg-kit-audio:5.1.LTS) and jetified-ffmpeg-kit-min-gpl-5.1-runtime (com.arthenica:ffmpeg-kit-min-gpl:5.1)

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

使用--stacktrace选项运行以获得堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的见解。

构建在6s内失败异常:Gradle任务assembleDebug失败,退出代码为1

sr4lhrrt

sr4lhrrt1#

如异常消息中所述,该问题是由模块“ffmpeg-kit-audio:5.1.LTS”和“ffmpeg-kit-min-gpl:5.1”中发现的重复类引起的。因此,每个类基本上有两个引用。我记得我不久前遇到过这个问题,我尝试了不同的解决方案,从启用Androidx(android.useAndroidX=true)和Jetier(android. enableJetier =true)到“排除“、“强制“和“配置“build.gradle中的依赖项,但都没有正常工作。
此外,我使用的是the "full" license,我遇到了这个问题的包依赖于其他许可证,如min,min-gpl,https-gpl。所以为了覆盖造成问题的包的ffmpeg依赖性,我从它的存储库中下载了源文件,然后在我的主文件夹中使用“Flutter Create --Template=Package Name_of_the_Package”执行X11 E1 F1 X操作。我将所有源文件从下载的包移到了新的包文件夹中,在将依赖项从下载的pubspec.yaml文件添加到新的pubspec.yaml文件中时,我只是简单地替换了原来的依赖项“ffmpeg_kit_flutter_https:5.1.0”由新的“ffmpeg_kit_flutter_full:5.1.0-LTS”的依赖关系,然后我就可以启动应用程序,它按预期工作了。
其中一个依赖项(video_editor)使用min-gpl许可证。只要您使用该依赖项,您就需要提供这些编解码器库(vid. stab,x264,x265,xvidcore)。您可以创建一个自定义软件包,并将ffmpeg许可证设置为“full-gpl”,其中包括音频和min-gpl库,但要注意gpl模块的许可证。

相关问题