“构建错误:构建失败,出现 4 个错误 UnityEngine.Debug:LogErrorFormat (string,object[])”,而在 Unity 中使用 Play Asset Deli

Posted

技术标签:

【中文标题】“构建错误:构建失败,出现 4 个错误 UnityEngine.Debug:LogErrorFormat (string,object[])”,而在 Unity 中使用 Play Asset Delievery 构建【英文标题】:"Build error: Build failed with 4 error(s) UnityEngine.Debug:LogErrorFormat (string,object[])" while building using Play Asset Delievery in Unity 【发布时间】:2022-01-15 00:42:47 【问题描述】:

您好,我正在使用 Unity 构建游戏。当我尝试上传 .aab 文件时出现问题,它说不能接受大于 150mb 的文件。

我使用 Play 资产交付解决了这个问题。我根据此here 创建了资产包,并按照此链接按照说明按照此link 构建文件。但是在构建文件时,它说需要 API 级别 31。它试图自动下载它但失败了。因此,根据video 使用命令提示符,我手动下载了 API 级别并克服了这个问题。但是在构建应用程序包时,我收到“编译失败错误”我附上的屏幕截图

ALso later build failed with 4 errors进来,控制台截图在这里:

这是控制台消息的样子:

Build error: Build failed with 4 error(s)
UnityEngine.Debug:LogErrorFormat (string,object[])
Google.android.AppBundle.Editor.Internal.BuildTools.BuildToolLogger:DisplayErrorDialog (string) (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildTools/BuildToolLogger.cs:95)
Google.Android.AppBundle.Editor.Internal.BuildTools.AndroidBuilder:Build (UnityEditor.BuildPlayerOptions) (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildTools/AndroidBuilder.cs:205)
Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder:BuildAndroidPlayer (UnityEditor.BuildPlayerOptions) (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/BuildTools/AppBundleBuilder.cs:179)
Google.Android.AppBundle.Editor.Internal.AppBundlePublisher:Build (Google.Android.AppBundle.Editor.Internal.BuildTools.AppBundleBuilder,Google.Android.AppBundle.Editor.Internal.AppBundlePublisher/AppBundleBuildSettings) (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/AppBundlePublisher.cs:175)
Google.Android.AppBundle.Editor.Internal.AppBundlePublisher:Build () (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/AppBundlePublisher.cs:139)
Google.Android.AppBundle.Editor.Internal.AppBundleEditorMenu:BuildAndroidAppBundle () (at Assets/GooglePlayPlugins/com.google.android.appbundle/Editor/Scripts/Internal/AppBundleEditorMenu.cs:66)

我尝试通过谷歌搜索解决此问题,但关于 Play Asset 交付,我没有找到任何出色的文章。

任何帮助都将不胜感激,因为我在过去 2 天都陷入了这个问题。如果您需要更多帮助,请告诉我

【问题讨论】:

【参考方案1】:

经过大量试验,我使用了 Unity 版本 2021.2.5f1 并检查了“单独的基础 Apk 基础”,它已经工作了。希望这对将来的任何人都有帮助

【讨论】:

以上是关于“构建错误:构建失败,出现 4 个错误 UnityEngine.Debug:LogErrorFormat (string,object[])”,而在 Unity 中使用 Play Asset Deli的主要内容,如果未能解决你的问题,请参考以下文章