An asset is marked with HideFlags.DontSave but is included in the build 解决方法
2017-09-06 09:26
1291 查看
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文件中,导致无法修复;
所以,大家如果碰到了和我一模一样的错误,如果没有找到解决方法,不妨尝试一下我的方法。当然如果找到了更好的方法,或者发现了真正原因,也希望可以指导我一下。谢谢啦。
相关文章推荐
- 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的解决办法
- Unity5 使用自带的字体导致BuildAssetbundle失败An asset is marked with HideFlags.DontSave but is included in the
- 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
- Build Assetbundle出错:An asset is marked as dont save, but is included in the build
- swift编码出现Call can throw, but it is not marked with 'try' and the error is not handled错误的解决
- "The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods i"解决方法
- the file is already open in an editor 解决方法
- 【iOS】Swift3:执行save()的时候出现:Call can throw, but it is not marked with 'try' and the error is not handl
- the file is already open in an editor 解决方法 .
- is not in the sudoers file解决方法
- Eclipse is running in a JRE, but a JDK is required 解决方法
- - No enclosing instance of type Test is accessible. Must qualify the allocation with an enclosing in
- Ubuntu12.04更新出现 The system is running in low-graphics mode解决方法
- You cannot run the non-logged version of bulk copy in this database. Please check with the DBO. 问题的解决方法
- Ubuntu技巧之 is not in the sudoers file解决方法
- Linux中“is not in the sudoers file”解决方法
- eclipse 3.7 search 报resource is out of sync with the file system 解决方法
- win7下U盘安装ubuntu14.04双系统+解决The system is running in low-grafics mode方法