Skip to content

Instantly share code, notes, and snippets.

@RimuruDev
Last active October 20, 2023 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RimuruDev/ed6e8b69fcfc4420004c4d928821b102 to your computer and use it in GitHub Desktop.
Save RimuruDev/ed6e8b69fcfc4420004c4d928821b102 to your computer and use it in GitHub Desktop.
[SOLVED] I drew an icon for a script. To display the script with my icon in the Unity editor. But now the project doesn't build. How and where to fix it? Unity3D - Build Failed because of "[Unity] ERROR: An asset is marked with HideFlags.DontSave but is included in the build:"
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Assets/External/Resources/ScriptIcons/DontDestroyOnLoadIcon.jpg'
Asset name: DontDestroyOnLoadIcon
(You are probably referencing internal Unity data in your build.)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Assertion failed on expression: 'm_LockCount == 0'
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Building - Failed to write file: resources.assets
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Building - Failed to write file: resources.assets
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Building - Failed to write file: resources.assets
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
@RimuruDev
Copy link
Author

RimuruDev commented Oct 20, 2023

[SOLVED]

Fixed it with following steps:

  • Make your icon "Texture Type - Editor GUI".
  • Make sure that the icon is not in the folders or subfolders "Resources", "Editor".

image
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment