Youtube_player_flutter: [BUG] Flutter 构建 apk:在模块 guava-26.0-android.jar 和 listenablefuture-1.0.jar 中发现重复的类

创建于 2020-09-04  ·  4评论  ·  资料来源: sarbagyastha/youtube_player_flutter

描述错误
当我尝试构建 apk 时, youtube_player_flutter版本 7.0.0+7 出现此错误:

% flutter build apk --no-shrink
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':app:checkReleaseDuplicateClasses'.          
> 1 exception was raised by workers:                                    
  java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-26.0-android.jar (com.google.guava:guava:26.0-android) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

  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 29s                                                     
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                      30.3s
Gradle task assembleRelease failed with exit code 1
joao@Mini-de-Joao opengames % flutter build apk --no-shrink
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':app:checkReleaseDuplicateClasses'.          
> 1 exception was raised by workers:                                    
  java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-26.0-android.jar (com.google.guava:guava:26.0-android) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

我通过将 youtube flutter 降级到版本来解决它:6.1.1

最有用的评论

我有同样的问题并解决了它[https://stackoverflow.com/questions/56639529/duplicate-class-com-google-common-util-concurrent-listenablefuture-found-in-modu]

所有4条评论

在调试模式下启动时出现同样的问题。

Launching lib/main.dart on Android SDK built for x86 64 in debug mode...

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-26.0-android.jar (com.google.guava:guava:26.0-android) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

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

@morphy2k你能解决这个问题吗?

我有同样的问题并解决了它[https://stackoverflow.com/questions/56639529/duplicate-class-com-google-common-util-concurrent-listenablefuture-found-in-modu]

非常感谢@apps-auth

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

kulture-rob-snider picture kulture-rob-snider  ·  5评论

DiegoLimeiradaSilva picture DiegoLimeiradaSilva  ·  4评论

megamonster21099 picture megamonster21099  ·  5评论

Xoshbin picture Xoshbin  ·  4评论

jumper900 picture jumper900  ·  3评论