Flutter 编译打包安卓com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar


报错信息

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>.
 

重读类 com.google.guava 导致的

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

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

android.useAndroidX=true
android.enableJetifier=true

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

2./android/app/build.gradle中

 

 

 添加

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

在尝试打包编译


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM