Error: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

Error: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

AndroidStudio 编译异常:

详细报错信息:

AGPBI: {"kind":"error","text":"Program type already present: com.google.common.util.concurrent.internal.InternalFutures","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/atoken/AndroidStudioProjects2/XX/app/build/intermediates/transforms/dexBuilder/debug/0.jar, /Users/atoken/AndroidStudioProjects2/XX/app/build/intermediates/transforms/dexBuilder/debug/1.jar, /Users/atoken/AndroidStudioProjects2/XX/app/build/intermediates/transforms/dexBuilder/debug/2.jar,
  Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
  Program type already present: com.google.common.util.concurrent.internal.InternalFutures
错误原因: implementation 'com.google.guava:guava:27.0-jre'

引入到依赖版本太新需要降级改为: implementation 'com.google.guava:guava:24.1-jre' 编译通过