• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by pandey611 · Oct 24, 2015 at 01:37 PM · build-errorbaking

Building - Failed to write file sharedassets0.assets UnityEditor.Hostview:OnGUI()

Hello all, I baked my scene, w$$anonymous$$ch created lightmaps of 1.8 GB in size. now when building my unity project with baked scene. Its throwing error. I am facing t$$anonymous$$s error always w$$anonymous$$le 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 t$$anonymous$$s issue.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Raven_Gothchild · Aug 19, 2017 at 10:08 PM 0
Share

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.

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by ismaelnascimento01 · Apr 04, 2019 at 05:16 AM

Look here: https://forum.unity.com/threads/solved-cannot-build-app-with-these-errors.487391/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

How can I stop the variable values reverting to its default values after being built? 1 Answer

Why would SystemInfo.Supports3DTextures be set to FALSE? 0 Answers

Google Cardboard build error 1 Answer

Can't build WebGL because of IL2CPP crash 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges