Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Clean Builds Corrupted

Discussion in 'Editor & General Support' started by DDNA, Jul 6, 2017.

  1. DDNA

    DDNA

    Joined:
    Oct 15, 2013
    Posts:
    116
    We have a build system that does clean builds of our project for distribution. Starts with a fresh directory, gets all the files, then does a build from the command line.

    The builds that come out of this process are corrupt. More specifically one of the first things I see is that many of the 2D sprites in our UI do not show up in the game. The log after running the build also has many of these errors

    d3d11: failed to create 2D texture shader resource view id=106 [D3D error was 80070057]

    The build also has many other problems, like speedtrees start behaving in insane ways etc...

    If I go to the build machine, open the project left over from the build process do a "Assets->Reimport All" then run the command line again, the build is fine and has none of these errors.

    Subsequently if I use this folder for incremental builds after this, those builds are fine as well. It is only the clean build that is corrupt.
     
  2. DDNA

    DDNA

    Joined:
    Oct 15, 2013
    Posts:
    116
    I was able to figure out what this is.

    There were textures in the build that were set to compress and were not powers of 2. You can correct this by either scaling the textures of turning off compression, and mip mapping. If they are not power of 2 having mip mapping on will cause this problem, and if they are not multiple of 4 Compression will cause this problem.

    The bigger problem for this is that Unity's behavior for this is horrible. We discovered this when we started doing clean builds because it was the one time when the warnings would show up. In addition these texture would just not show up in the game. Think about this scenario for a second.

    During development, everything is fine, no warnings.
    Do an incremental build or a build from the editor, no warnings, works fine.
    Spit a clean build out, the build gets these cryptic errors and doesn't work.

    It is like a nightmare scenario for putting builds together. On top of this the errors don't tell you which texture is the problem so it is very hard to find this.

    The weirdest part is that if I go to my build machine to a build that has already been generated then open the project in unity and close it, all the incremental builds will work at that point.

    I would like to be doing clean builds but I am terrified to now.

    I setup a simple test case and reported this
    (Case 939236) NPOT Textures cause Clean Builds to Fail without warning