An asset is marked with HideFlags.DontSave but is included in the build 解决方法
来源:互联网 发布:网络销售流程 编辑:程序博客网 时间:2024/06/01 10:04
1 错误描述
版本: Unity 2017.1.0f3
平台:PC,x86_x64
错误描述:
Unity打包时报错,总共有三个错,如下:
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: ‘Library/unity editor resources’
Asset name: DefaultHDRI
(You are probably referencing internal Unity data in your build.)
UnityEditor.HostView:OnGUI()
Building - Failed to write file: sharedassets0.assets
UnityEditor.HostView:OnGUI()
UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
UnityEditor.HostView:OnGUI()
2 解决过程
网上各种类似的错误,几乎都是使用替换字体来解决的,最开始我也是这么做的,写了个替换字体的脚本,但是替换之后发现,没有用!!!依然报同样的错,我把场景里的,project里面的都改了一遍,依然报错。
无奈之下,只好使用排除法,一个对象一个对象的删除,不断的打包测试哪一个影响了打包,最后几乎删光了,依然还在报错。这时候的我一脸懵逼。还好最好灵光一闪,我新建了一个空场景,然后把原场景的文件都复制到这个空场景中(可使用Prefab来操作,也可以直接从场景中拉过来然后卸载旧场景并选择不保存),这时候再打包,竟然竟然可以了!!!!
3 结论
根据第一个报错Asset: ‘Library/unity editor resources’,指向Asset name: DefaultHDRI,所以我估计一定是场景中某个位置引用了Unity编辑器的内部资源,但是哪个引用了不知道,不一定是字体,最后我通过替换场景文件解决了这个问题,有两种可能:
1. 这个引用只与场景挂钩,与场景内的对象无关;
2. 这个引用也有可能是一种残留,残留在.unity文件中,导致无法修复;
所以,大家如果碰到了和我一模一样的错误,如果没有找到解决方法,不妨尝试一下我的方法。当然如果找到了更好的方法,或者发现了真正原因,也希望可以指导我一下。谢谢啦。
- An asset is marked with HideFlags.DontSave but is included in the build 解决方法
- Unity 解决 An asset is marked with HideFlags.DontSave but is included in the build 问题。
- An asset is marked with HideFlags.DontSave but is included in the build:
- An asset is marked with HideFlags.DontSave but is included in the build
- unity 项目build 的时候后报错An asset is marked with HideFlags.DontSave but is included in the build:
- unity 项目build 的时候后报错An asset is marked with HideFlags.DontSave but is included in the build:
- 打包的时候报错 An asset is marked with HideFlags.DontSave but is included in the build的解决办法
- Unity5 使用自带的字体导致BuildAssetbundle失败An asset is marked with HideFlags.DontSave but is included in the
- Call can throw, but it is not marked with 'try' and the error is not handled
- Swift:Call can throw, but it is not marked with 'try' and the error is not handled
- Swift Call can throw, but it is not marked with 'try' and the error is not handled
- Call can throw but it is not marked with try
- Unity3d Error---Build failed : Asset is marked as don't save
- [cnblogs镜像]Unity "Build failed : Asset is marked as don't save " 解决方案
- the file is already open in an editor 解决方法
- the file is already open in an editor 解决方法 .
- swift编码出现Call can throw, but it is not marked with 'try' and the error is not handled错误的解决
- JAX-WS 2.2 API is required, but an older version was found in the JDK.
- noip2010引水入城-搜索+贪心
- RGB转MIPI DSI-TC358778XBG转换芯片,优于SSD2828方案。
- 教你5种JSP页面显示为乱码的解决方法
- UGUI 学习笔记8 Slider
- UVA 400
- An asset is marked with HideFlags.DontSave but is included in the build 解决方法
- Linux基础
- Sass插值、注释、数据类型、自定义函数
- RISC和CISC比较
- elasticsearch in 语句
- jQuery基础入门学习
- Linux相关知识
- UVA 11234
- css基础--联合选择器