- Home /
Building - Failed to write file sharedassets0.assets UnityEditor.Hostview:OnGUI()
Hello all, I baked my scene, which created lightmaps of 1.8 GB in size. now when building my unity project with baked scene. Its throwing error. I am facing this error always while building my unity project.
success && actual == (uint64)size UnityEditor.Hostview:OnGUI() Building - Failed to write file sharedassets0.assets UnityEditor.Hostview:OnGUI() Error building Player: Couldn't build player because of unsupported data on target platform.
I am using unity3d 5.0.0. Please let me know how to solve this issue.
I just got the same error building a project with 2017.1.0f3. I started development using 5.6 and I use some of the standard assets, I get some complaints about obsolete shader code from Assets/Standard Assets/Effects/ImageEffects/Scripts/SunShafts.cs(93,52): warning CS0618:
UnityEngine.Camera.hdr' is obsolete: use Camera.allowHDR ins$$anonymous$$d.'
and a few others but also now I am getting:
Shader error in 'Standard': Too many math instructions for S$$anonymous$$2.0 (65 needed, max is 64). Try #pragma target 3.0 at /Program Files/Unity/Editor/Data/CGIncludes/UnityStandardCore.cginc(426) (on d3d9)
Compiling Fragment program with DIRECTIONAL LIGHT$$anonymous$$AP_ON FOG_EXP2 _NOR$$anonymous$$AL$$anonymous$$AP
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_$$anonymous$$AS$$anonymous$$_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NOR$$anonymous$$AL$$anonymous$$AP SHADER_API_DES$$anonymous$$TOP
Shader error in 'Standard': Too many math instructions for S$$anonymous$$2.0 (66 needed, max is 64). Try #pragma target 3.0 at /Program Files/Unity/Editor/Data/CGIncludes/UnityStandardCore.cginc(426) (on d3d9)
Compiling Fragment program with DIRECTIONAL LIGHT$$anonymous$$AP_ON FOG_EXP2 _E$$anonymous$$ISSION _NOR$$anonymous$$AL$$anonymous$$AP
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_$$anonymous$$AS$$anonymous$$_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NOR$$anonymous$$AL$$anonymous$$AP SHADER_API_DES$$anonymous$$TOP
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()
UnityEditor.BuildPlayerWindow+Build$$anonymous$$ethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuild$$anonymous$$ethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\$$anonymous$$ono\BuildPlayerWindowBuild$$anonymous$$ethods.cs:162
at UnityEditor.BuildPlayerWindow.CallBuild$$anonymous$$ethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\$$anonymous$$ono\BuildPlayerWindowBuild$$anonymous$$ethods.cs:83
UnityEditor.HostView:OnGUI()
I've never seen any of these errors before, my project built just fine with 5.6.
Answer by firestorm185 · Jun 12, 2020 at 07:24 AM
I tried the solutions stated there, still no solution. I'll post back here if I find one.
Answer by summernight2001519 · Sep 20, 2021 at 07:47 AM
I figured out what happened, I used a texture generated with PrefabUtility.GetIconForGameObject, then I used it in my scene, but the texture is generated and didn't exist in the project, so that texture can't be saved, thus an error occurred when building. Solution: Find or remember what you have generated since the last successful build and didn't save it into the project, in my case is a texture, remove it or replace it solves the issue. @firestorm185
Answer by unity_I-JLXCYeQIIqcw · Oct 01, 2021 at 10:08 AM
In my case the problem was that I copied scene file from an old version so there was dangling pointer in it cause the issue. Solution delete game objects one by one and then build. Once the build is successful it means that object is faulty needs to be recreated