![](/img/trans.png)
[英]Why am I getting "Failed to execute aapt" error on Flutter after run?
[英]Why I am getting this error after Flutter Run?
在我運行 flutter 項目后,我收到以下 Build failed 異常。
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.google.android.exoplayer2.ui.DownloadNotificationHelper found in modules jetified-exoplayer-core-2.17.0-runtime (com.google.android.exoplayer:exoplayer-core:2.17.0) and jetified-exoplayer-ui-2.15.1-runtime (com.google.android.exoplayer:exoplayer-ui:2.15.1)
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 3m 26s
Running Gradle task 'assembleDebug'... 208.9s
Exception: Gradle task assembleDebug failed with exit code 1
我目前正在使用 Flutter 的最新版本,即 2.10.1 版。 同樣在我的項目中,我使用了“better_player”酒吧 package。
請給我一個解決方案。
在文件末尾的依賴項中的 app/build.gradle 中添加以下依賴項 -
實施 'com.google.android.exoplayer:exoplayer:2.17.0'
例子 -
dependencies {
...
implementation 'com.google.android.exoplayer:exoplayer:2.17.0'
}
第一:如果你使用 video_player 在你的 app/build.gradle 添加這一行
implementation 'com.google.android.exoplayer:exoplayer:2.17.1'
第二:如果你使用 better_player 在你的 app/build.gradle 添加這一行
implementation 'com.google.android.exoplayer:exoplayer:2.15.0'
第三:如果您同時使用video_player和better_player ,則應在 pubspec.yaml 中將video_player版本降級為 2.1.12
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.