Error: Building – Failed to write file: sharedassets4.assets

More solutions for stupid / not intuitive console messages.

This time, when I try to compile to my Android device, my Unity project is shouting me these errors:

An asset is marked with HideFlags.DontSave but is included in the build:
Asset: ‘Library/unity editor resources’
(You are probably referencing internal Unity data in your build.)


Building – Failed to write file: sharedassets4.assets


After some searching I found that – in my specific case – this is related to a prefab that was copied from another project and it had a NGUI UILabel with a font that does not exist in my current project. After changing my font to another one (that actually exists in my project) I could compile without problems.