Search Unity

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,085
    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,317
    NatCou likes this.
  3. Nick-Nexefy

    Nick-Nexefy

    Joined:
    Mar 20, 2019
    Posts:
    8
    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:
    130
    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:
    668
    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.
     
  10. unity_NTyxeB384OxNOQ

    unity_NTyxeB384OxNOQ

    Joined:
    Mar 5, 2019
    Posts:
    4
    Had the same issue with a random .png file. Deleted the meta file and build worked.
     
  11. jotamaza

    jotamaza

    Joined:
    Apr 12, 2015
    Posts:
    9
    This worked for me.
     
  12. kaan0550

    kaan0550

    Joined:
    Jun 2, 2019
    Posts:
    10
    Worked for me too!
     
  13. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,443
    There is a LIKE button on every post so you can express approval without churning up an old post.
     
  14. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    FYI this can happen if you use the same image for a script icon as in the game.

    If you want to use the same icon in-game as an icon for a component duplicate the image and put it in editor default resources or something.

    Deleting the meta file or other solutions only work temporarily, probably until you compile a script.
     
    dhanrajsinh24 likes this.