[Solved] Cannot Build App with these Errors

I can't seem to build a hololens app because of these errors

[quote]
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Library/unity editor resources'
[/quote]

[quote]
Building - Failed to write file sharedassets0.assets
UnityEditor:HostView:OnGui()
[/quote]

[quote]
DirectoryNotFoundException: Destination directory not found: Temp\StagingArea\Data\Resources
[/quote]

[quote]
UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer
[/quote]

I tried build my project in a new steril project with the same results. I can't seem to fix the problem.

I downgraded from 2017.1.0f3 to 2017.1.0f2 with the same resutl

Found the solution.

I created a new scene and transfered the objects to the new one. I changed the scene in the build and everything works now.

5 Likes

Hi DrunkReaperMatt.
your solution save me!!
thank you man.

Hi, thanks my friend! after one day searching google and try everything no one could help me to fix this issue!! just this solution worked!
this kind of error is not good! no help! no correct warning or message in console! just throwing unnecessary exception form another part of building phase that could not help to solve this problem!

I fixed this by going into the properties of the project folder and made sure none were marked as Read Only and it worked for me.

1 Like

the advice is helpful,i have never considered this


I didn't help in my case, but at least I found a workaround without a need to restart Unity editor - just remove and add the scene in build options. But it's still really annoying.

I got 31 error, similar to that one:

An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Library/unity editor resources'
Asset name: Font Material
(You are probably referencing internal Unity data in your build.)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

or

An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Library/unity editor resources'
Asset name: toggle on act
(You are probably referencing internal Unity data in your build.)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Any ideas on how to figure out what exactly causes these errors?

Rolling back the changes in my scene.unity file solved it for me, sadly couldn't find out which line exactly was causing the error.


Hi what do you use to back these up?

I've tried both taking the scene out and loading it back in and checking to make sure no project folder items are read only... still broken.


Version control of course, I'm using git.


thanks, I used to do manual backups but implemented Git for my current project and it is a game changer, can't believe I hadn't used it all this time.

I found the solution. There was an animation file which includes many frames and high quality. I decrease this frame assets quality to 1024. Resolution decreased little bit but issue solved. I think its about the file sizes.


Thanks a lot. You saved my life :)

that was my solution free up space8160569--1060988--image_2022-05-27_112543061.png Unity cant create file


Thank you!


Thank you very much! Worked like a charm!

Had a issue with an error like this on a PNG file and turning off "Read/Write" on the file fixed it .