Unity3D - 构建失败,因为“[Unity] 错误:资产标记为 HideFlags.DontSave 但包含在构建中:”

Posted

技术标签:

【中文标题】Unity3D - 构建失败,因为“[Unity] 错误:资产标记为 HideFlags.DontSave 但包含在构建中:”【英文标题】:Unity3D - Build Failed because of "[Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:" 【发布时间】:2020-07-19 03:03:33 【问题描述】:

使用 Unity Cloud Build Service,我的构建失败,原因是 “[Unity] 错误:资产标有 HideFlags.DontSave 但包含在构建中:” 错误。

到目前为止我做了什么:

1) 我已尝试删除 Project Setting 并重新打开 Unity,但构建仍然失败...

2) 将预制件和所有场景上的所有“Arial”字体更改为自定义字体,但仍然失败...

以下是 Unity Build Service 的精简日志:

1207: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
1208: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
1209: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
1210: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
1211: [Unity] Script attached to 'Scene Variables' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1212: [Unity] Script attached to 'Scene Variables' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1213: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1214: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1215: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1216: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
1217: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
1218: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
1219: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
1220: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Memorize_Alphabet_Portable.unity' is missing or no valid script is attached.
1221: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Memorize_Alphabet_Portable.unity' is missing or no valid script is attached.
1222: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Memorize_Alphabet_Portable.unity' is missing or no valid script is attached.
1223: [Unity] Script attached to 'Scene Variables' in scene 'Assets/z_scene/ENGLISH/Games/EN_Memorize_Alphabet_Portable.unity' is missing or no valid script is attached.
1224: [Unity] Script attached to 'Scene Variables' in scene 'Assets/z_scene/ENGLISH/Games/EN_Memorize_Alphabet_Portable.unity' is missing or no valid script is attached.
1225: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
1226: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
1227: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
1228: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
1229: [Unity] WARNING: Shader Unsupported: 'VR/SpatialMapping/Wireframe' - Pass '' has no vertex shader
1230: [Unity] WARNING: Shader Unsupported: 'VR/SpatialMapping/Wireframe' - Setting to default shader.
1231: [Unity] WARNING: Shader Unsupported: 'Hidden/VR/BlitTexArraySliceToDepth_MSAA' - Pass '' has no vertex shader
1232: [Unity] WARNING: Shader Unsupported: 'Hidden/VR/BlitTexArraySliceToDepth_MSAA' - Setting to default shader.
1233: [Unity] WARNING: Shader Unsupported: 'AR/TangoARRender' - Pass '' has no vertex shader
1234: [Unity] WARNING: Shader Unsupported: 'AR/TangoARRender' - Setting to default shader.
1235: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1236: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1237: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1238: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1239: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1240: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1241: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1242: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1243: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1244: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1245: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1246: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1247: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1248: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1249: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1250: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1251: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1252: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1253: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1254: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1255: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1256: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1257: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1258: [Unity] Asset name: Lucida Grande Warning
1259: [Unity] Asset name: Lucida Grande Warning
1260: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:
1261: [Unity] ERROR: Building - Failed to write file: 0000000000000000d000000000000000
1262: [Unity] ERROR: File Library/Unused/20ae6e83037504fb99d7208afe1c36b4 couldn't be written. Because moving /BUILD_PATH/.dwwuslmlg/Temp/UnityTempFile-86ecb9516b1844531adb4c072554c356 to /BUILD_PATH/Library/Preferences/Unity/Editor-5.x/Layouts/LastLayout.dwlt failed.
1263: [Unity] ERROR: File Library/Unused/20ae6e83037504fb99d7208afe1c36b4 couldn't be written. Because moving /BUILD_PATH/pt.dwwuslmlg/Temp/UnityTempFile-b24e1fe5446324486b458ff5fe9e8e9d to /BUILD_PATH/Library/Preferences/Unity/Editor-5.x/Layouts/LastLayout.dwlt failed.
1264: publishing finished successfully.
1265: Finished: FAILURE

完整日志您可以找到here...

有什么想法吗?

提前谢谢你...

【问题讨论】:

【参考方案1】:

我会把你的日志分成几部分并回答你

1207: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no 
vertex shader
1208: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default 
 shader.
1209: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
1210: [Unity] WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.

这里有一些着色器错误(我认为那些是后期处理着色器) 检查这些着色器BlitToDepth_MSAABlitToDepth

1211: [Unity] Script attached to 'Scene Variables' in scene'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1212: [Unity] Script attached to 'Scene Variables' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1213: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1214: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.
1215: [Unity] Script attached to 'Missing Prefab (Dummy)' in scene 'Assets/z_scene/ENGLISH/Games/EN_Guess_Object_Portable.unity' is missing or no valid script is attached.

这些错误来自某些对象和场景 转到EN_Guess_Object_Portable 场景并检查scene variables 对象。此对象的脚本无效。

并且缺少预制件,并且该预制件也有无效的脚本。检查同一场景中的Missing Prefab (Dummy)对象

1235: [Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:

要解决此错误,您需要从构建设置中取消勾选所有场景

然后您需要通过勾选一个场景并单击构建来构建一个场景 这样你就可以找到哪个场景有错误,然后你可以解决那个场景中的错误

看看资产调用Lucida Grande这个资产有一些错误

【讨论】:

谢谢,我会试试的 嗨@Yonal 我检查了我所有的字体,没有“Lucida Grande”,我也删除了所有丢失的预制件。但构建仍然失败并且错误消息仍然相同。有什么想法吗? 我也取消了所有场景并创建空白场景来构建设置,但构建错误仍然相同...... @coderInrRain 您是否使用编辑器脚本(其中包含“使用 UnityEditor”的脚本)然后将这些脚本文件放在名为“Editor”的文件夹中,然后尝试构建 @Yohnal 什么是蒸馏器?【参考方案2】:

貌似是DoozyUI插件引起的,thisunity论坛也有类似的情况。

我们已经让其他客户在使用 DoozyUI 插件时遇到了完全相同的行为。问题在于插件中的 GUISkins,一旦移动到编辑器默认资源文件夹并修复相关脚本,问题就解决了。

【讨论】:

嗨 0xBFE1A8 是的,我有很棒的 ui 插件,我会检查这个...谢谢 我已经删除了 Doozy UI 插件,但仍然无法解决,仍然出现构建错误... 我已经尝试过了,但是现在迁移到 Unity 2019 会花费太多精力。

以上是关于Unity3D - 构建失败,因为“[Unity] 错误:资产标记为 HideFlags.DontSave 但包含在构建中:”的主要内容,如果未能解决你的问题,请参考以下文章

Unity3D - CommandInvokationFailure:重新打包资源失败

使用 Unity3d 的更改更新 xcode 项目

Unity3D之导出的Apk安装失败

Unity3D 游戏构建中没有键盘输入

Scanvenger游戏制作笔记Unity3D控制游戏的失败

unity3d编辑器应用安装失败