当我想运行这些应用程序时,我会得到错误。
任务的
执行失败:app:checkDebugDuplicateClasses‘。
我使用的软件包是:
^0.8.3+2
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.android.exoplayer2.ui.package-info found in modules jetified-exoplayer-common-2.14.1-runtime.jar (com.google.android.exoplayer:exoplayer-common:2.14.1) and jetified-exoplayer-ui-2.13.2-runtime.jar (com.google.android.exoplayer:exoplayer-ui:2.13.2)
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 53s我怎么才能解决这个问题?
后加
dependency_overrides:
video_player: 2.1.13
e: D:\flutter\.pub-cache\hosted\pub.dartlang.org\wakelock-0.4.0\android\src\main\kotlin\creativemaybeno\wakelock\Wakelock.kt: (8, 16): Redeclaration: Wakelock
e: D:\flutter\.pub-cache\hosted\pub.dartlang.org\wakelock-0.4.0\android\src\main\kotlin\creativemaybeno\wakelock\Wakelock.kt: (41, 7): Redeclaration: NoActivityException
e: D:\flutter\.pub-cache\hosted\pub.dartlang.org\wakelock-0.5.3+3\android\src\main\kotlin\creativemaybeno\wakelock\Wakelock.kt: (8, 16): Redeclaration: Wakelock
e: D:\flutter\.pub-cache\hosted\pub.dartlang.org\wakelock-0.5.3+3\android\src\main\kotlin\creativemaybeno\wakelock\Wakelock.kt: (41, 7): Redeclaration: NoActivityException
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':wakelock:compileDebugKotlin'.
> Compilation error. See log for more details
* 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 24s发布于 2021-08-18 10:00:28
删除pubspec.lock并运行flutter pub get。
基本上,由于video_editor使用video_player的v2.1.12作为依赖项而导致版本不匹配,而后者又使用了系外播放器。
这是一个简单的方法。
另一种选择是使用依赖覆盖,但这不安全
dependency_overrides:
video_player: 2.1.13依赖项重写https://dart.dev/tools/pub/dependencies#dependency-overrides的参考文档
发布于 2021-11-16 10:52:02
这对我有用。
1. flutter clean
2. flutter runhttps://stackoverflow.com/questions/68813529
复制相似问题