gpt4 book ai didi

android - Unity Android构建错误重复类

转载 作者:行者123 更新时间:2023-12-04 23:59:24 62 4
gpt4 key购买 nike

Unity 版本:Unity 2020.1.17f
为Android构建游戏后,我得到了这些错误
在播放器设置中,我检查了自定义主 list 、自定义启动器 list 、自定义启动器 Gradle 模板和自定义 Gradle 属性模板
我尝试了一切,请帮助
当我制作 Android Resolver 时发生此错误

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>

最佳答案

当您使用不同版本的 Play Services Resolver 导入多个 SDK 时,通常会出现此错误。
解决方案:

  • 删除已解析的库并再次解析
  • Assets > Play Services Resolver > Android Resolver > Delete Resolved Libraries
  • Assets > Play Services Resolver > Android Resolver > Resolve

  • 再次包含 SDK
  • 删除导入的 SDK
  • 再次导入 SDK,但这次只检查一个工具的解析器
  • Assets > Play Services Resolver > Android Resolver > Resolve

  • 手动删除重复的类(在最坏的情况下)
  • 在 Assets > Play Services Resolver > Android Resolver > Settings 中禁用自动解析。
  • 在资源文件夹中找到日志中提到的重复类并将其删除(例如删除'androidx.annotation.annotation-1.1.0.jar'并保留'annotation-1.1.0.jar')

  • 关于android - Unity Android构建错误重复类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66704978/

    62 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com