Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

An asset is marked with HideFlags.DontSave but is included in the build

Discussion in 'Editor & General Support' started by SteveJ, Jul 6, 2018.

  1. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,066
    I can't build my project as I'm just getting errors in the log. This was working fine earlier, and the problem seems to be caused by the fact that I deleted a Scene (that was just for testing).

    I've seen a couple of threads suggesting deleting Library, deleting Project Settings. Neither of those has solved the issue.

    Any ideas?

     
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    1,315
    NatCou likes this.
  3. Nick-Nexefy

    Nick-Nexefy

    Joined:
    Mar 20, 2019
    Posts:
    6
    If you're using Alembic in your project, we found scenes (and presumbly prefabs) where a nested mesh renderer underneath a gameobject with an Alembic Stream Player would stop the build from completing. Such behavior is intended. Alembic is marking all children as 'HideAndDontSave' because otherwise every time you change your alembic frame, you will get a scene bloat.
    The solution this problem is to parent the ABC and FBX to a common GameObject and make a Prefab out of that instead of adding the FBX Prefab to the ABC Prefab.
     
  4. amit-chai

    amit-chai

    Joined:
    Jul 2, 2012
    Posts:
    80
    Copying scene files to a new scene solved it.
     
  5. kadd11

    kadd11

    Joined:
    Mar 11, 2018
    Posts:
    33
    Just want to add in case it helps anyone else, I had a script that was mistakenly setting the hide flags on a shader that I was dynamically loading to DontSave. Unity somehow reserializes that and it was causing issues, despite nothing in the meta file or anywhere else indicating that it had changed.
     
  6. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    114
    In my case, I had a scriptable object that is for editor and I placed it incorrectly inside the resources folder, once I moved it out from resources folder, everything build fine
     
    FlightOfOne and DgoodingIndi like this.
  7. Syr_2

    Syr_2

    Joined:
    Jun 12, 2021
    Posts:
    3
    Very helpful - I have the same issue with an alembic-file. But your solution didn't work yet for me.. Have to bruteforce it a bit
     
  8. Syr_2

    Syr_2

    Joined:
    Jun 12, 2021
    Posts:
    3
    And btw. Make sure there is NOT A SINGLE old prefab file anywhere that coudl cause the bug again. If you dont find all prefab files, simply copy the "bugged" fbx file and delete it then. Move the copy back and remake all the prefab files. They kills all thx fbx's links to other prefab files and solves the problem.
     
  9. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    659
    Leaving this for my future self, As said by Omar, I had a folder named resources (note that this is not THE Resources folder, some sub folder I created), after renaming it, everything worked fine.