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 instead.'
and a few others but also now I am getting:
Shader error in 'Standard': Too many math instructions for SM2.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 LIGHTMAP_ON FOG_EXP2 _NORMALMAP
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
Shader error in 'Standard': Too many math instructions for SM2.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 LIGHTMAP_ON FOG_EXP2 _EMISSION _NORMALMAP
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
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+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()
I’ve never seen any of these errors before, my project built just fine with 5.6.
I tried the solutions stated there, still no solution. I’ll post back here if I find one.
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
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