美文网首页
Flutter 编译打包安卓com.google.common.

Flutter 编译打包安卓com.google.common.

作者: 天渺工作室 | 来源:发表于2020-10-22 11:26 被阅读0次

报错信息

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.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) 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>.

image.gif

重读类 com.google.guava 导致的

本地的Flutter 升级了一次SDK,就出这个错误

1.先查看android/gradle.properties文件 有没有

android.useAndroidX=true
android.enableJetifier=true
image.gif

没有的话 加上,工程本身就有 可以不用管

2./android/app/build.gradle中

image

image.gif

添加

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
image.gif

在尝试打包编译

相关文章

网友评论

      本文标题:Flutter 编译打包安卓com.google.common.

      本文链接:https://www.haomeiwen.com/subject/pwuumktx.html