首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >统一Android构建错误复制类

统一Android构建错误复制类
EN

Stack Overflow用户
提问于 2021-03-19 08:43:28
回答 1查看 4.3K关注 0票数 4

统一版本:团结2020.1.17f

在为Android构建游戏之后,我得到了这些错误

在“播放器设置”中,我检查了“自定义主报表”、“自定义发射器清单”、“自定义启动程序分级模板”和“自定义Gralde属性”模板

我什么都试过了,请帮忙

这个错误发生在我制作Android Resolver时。

代码语言:javascript
运行
复制
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':launcher:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.customtabs.ICustomTabsCallback found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.ICustomTabsCallback$Stub$Proxy found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.ICustomTabsService found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.ICustomTabsService$Stub$Proxy found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.IPostMessageService found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.customtabs.IPostMessageService$Stub$Proxy found in modules browser-1.0.0-runtime.jar (androidx.browser:browser:1.0.0) and jetified-androidx.browser.browser-1.0.0-runtime.jar (:androidx.browser.browser-1.0.0:)
  Duplicate class android.support.v4.app.RemoteActionCompatParcelizer found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class android.support.v4.graphics.drawable.IconCompatParcelizer found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.2.0-runtime.jar (androidx.core:core:1.2.0) and jetified-androidx.core.core-1.3.2-runtime.jar (:androidx.core.core-1.3.2:)
  Duplicate class androidx.annotation.AnimRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.AnimatorRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.AnyRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.AnyThread found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.ArrayRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.AttrRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.BinderThread found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.BoolRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.CallSuper found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.CheckResult found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.ColorInt found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.ColorLong found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.ColorRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.ContentView found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.DimenRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.Dimension found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.DrawableRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.FloatRange found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.FontRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.FractionRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.GuardedBy found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.HalfFloat found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.IdRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.InspectableProperty found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.InspectableProperty$EnumEntry found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.InspectableProperty$FlagEntry found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.InspectableProperty$ValueType found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.IntDef found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.IntRange found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.IntegerRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.InterpolatorRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.Keep found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.LayoutRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.LongDef found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.MainThread found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.MenuRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.NavigationRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.NonNull found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.Nullable found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.PluralsRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.Px found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RawRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RequiresApi found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RequiresFeature found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RequiresPermission found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RequiresPermission$Read found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RequiresPermission$Write found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RestrictTo found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.RestrictTo$Scope found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.Size found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.StringDef found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.StringRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.StyleRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.StyleableRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.TransitionRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.UiThread found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.VisibleForTesting found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.WorkerThread found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.annotation.XmlRes found in modules annotation-1.1.0.jar (androidx.annotation.annotation-1.1.0.jar) and annotation-1.1.0.jar (androidx.annotation:annotation:1.1.0)
  Duplicate class androidx.arch.core.executor.ArchTaskExecutor found in modules core-runtime-2.0.1-runtime.jar (androidx.arch.core:core-runtime:2.0.1) and jetified-androidx.arch.core.core-runtime-2.0.1-runtime.jar (:androidx.arch.core.core-runtime-2.0.1:)
  Duplicate class androidx.arch.core.executor.ArchTaskExecutor$1 found in modules core-runtime-2.0.1-runtime.jar (androidx.arch.core:core-runtime:2.0.1) and jetified-androidx.arch.core.core-runtime-2.0.1-runtime.jar (:androidx.arch.core.core-runtime-2.0.1:)
  Duplicate class androidx.arch.core.executor.ArchTaskExecutor$2 found in modules core-runtime-2.0.1-runtime.jar (androidx.arch.core:core-runtime:2.0.1) and jetified-androidx.arch.core.core-runtime-2.0.1-runtime.jar (:androidx.arch.core.core-runtime-2.0.1:)
  Duplicate class androidx.arch.core.executor.DefaultTaskExecutor found in modules core-runtime-2.0.1-runtime.jar (androidx.arch.core:core-runtime:2.0.1) and jetified-androidx.arch.core.core-runtime-2.0.1-runtime.jar (:androidx.arch.core.core-runtime-2.0.1:)
  Duplicate class androidx.arch.core.executor.DefaultTaskExecutor$1 found in modules core<message truncated>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-19 09:46:14

当您使用不同版本的Play Services Resolver导入多个SDK时,经常会发生此错误。

解决方案:

  1. 删除已解析的库并再次解析

代码语言:javascript
运行
复制
- Assets > Play Services Resolver > Android Resolver > Delete Resolved Libraries
代码语言:javascript
运行
复制
- Assets > Play Services Resolver > Android Resolver > Resolve

  1. 包括SDK再一次

代码语言:javascript
运行
复制
- Delete imported SDKs
代码语言:javascript
运行
复制
- Import SDKs again, but this time check the resolver for only one tool
代码语言:javascript
运行
复制
- Assets > Play Services Resolver > Android Resolver > Resolve

  1. 手动删除重复类(在最坏的情况下)

代码语言:javascript
运行
复制
- In Assets > Play Services Resolver > Android Resolver > Settings disable auto resolve.
代码语言:javascript
运行
复制
- Find in resources folder duplicate classes mentioned in log and delete them ( eg. delete 'androidx.annotation.annotation-1.1.0.jar' and keep 'annotation-1.1.0.jar')
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66704978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档