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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

4.5 Builds not working - resources.assets' is corrupted!

Discussion in 'Editor & General Support' started by Okari-Draconis, Jun 4, 2014.

  1. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    ***Update -- This looks to have been an issues with how unity was handling generics ****
    At least that was our issues


    Only during builds in 4.5 do I get these errors..?
    Any Fix to them? Or is this a bug?
    Builds worked just fine in 4.3.4


    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/sharedassets2.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 142139508 > 142139504]

    (Filename: Line: 273)

    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/sharedassets2.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 142139464 > 142139460]

    (Filename: Line: 273)

    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/sharedassets2.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 142139420 > 142139416]

    (Filename: Line: 273)

    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/sharedassets2.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 142139380 > 142139376]

    (Filename: Line: 273)

    UnloadTime: 0.506547 ms
    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/resources.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 487487628 > 487487624]

    (Filename: Line: 273)

    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/resources.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 487487108 > 487487104]

    (Filename: Line: 273)

    The file 'C:/Users/Mark/Documents/Vergeous/Novus/ffff_Data/resources.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds! 487488188 > 487488184]

    (Filename: Line: 273)
     
    Last edited: Jul 10, 2014
  2. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    Any Ideas anyone?
     
  3. Graham-Dunnett

    Graham-Dunnett

    Unity Technologies

    Joined:
    Jun 2, 2009
    Posts:
    4,287
    Are all those files created by 4.5? Occasionally these errors appear if a 4.5 runtime is trying to load data files that were created in an older version. You can see which version these files were created in my looking at them in a text editor. Although they are most certainly binary, there is a 7-character representation of the version number near the start of the file.

    If you have data files created by the 4.5 version of Unity, then these errors are possibly related to serialisation. (But I'd assume the first given that these errors report a 4-byte difference.)
     
  4. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    I thought too at first, but then I changed the name of the build and the same issue occured
     
  5. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    For what it's worth, we used to have this problem last summer, fixed with an asset tidyup and reimport. I never found what the actual cause was and so was unable to report a bug for it, couldn't really submit many gigs of our IP.
     
  6. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    Found out the problem: Looks like unity 4.5 didn't like my multi-Inherited nested generics. Long story short, I went with a Simpler solution and its working fine now.
     
  7. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    I'm having the same problem. Checked asset version and it's 4.5.1f3 (correct). I don't see where the problem can come from. @Graham Dunnett any hints on what can cause this?

    It reports position out of bounds, and the difference reported it seems to be always 32.
     
    Last edited: Jul 9, 2014
  8. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    More details... I found the exact class that gives me trouble, and it seems to be my BindList class.

    My MonoBehaviour has a reference to BindList (no defined fields). BindList inherits from CustomList<Bind>. CustomList layout is (Bind[], int, int). Bind layout is (string, Component, string, bool, bool). All those are classes, marked with Serializable.

    Everything works fine in editor, I think I'm managing serialized classes and fields properly, and cannot find why the resources bundle isn't generated properly.
     
  9. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    Hm, have you checked if any of your properties may not be making it into the build somehow? It's a long shot, as it normally causes a secondary warning at runtime, but it does cause this sort of corruption, by screwing up the serialization stream length.
     
  10. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    I've checked, but I don't see how they could be affected. No clue.

    CustomList<T>:

    public T[] buffer;
    internal int size = 0;
    int initialSize;​

    Bind:

    [SerializeField]
    internal string id;
    [SerializeField]
    internal Component component;
    [SerializeField]
    internal string fieldName;

    public bool state1;
    public bool state2;

    [NonSerialized]
    internal FieldInfo field;
    Note that Bind implements ISerializationCallbackReceiver, which basically fills the FieldInfo after deserialization
     
  11. frarees

    frarees

    Joined:
    Jun 8, 2012
    Posts:
    29
    Seems to be related with
    • (612215) Scripting: Fixed support for serializing array of generic types
    I've updated to 4.5.1p4 and it seems to work. Thanks guys!
     
  12. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    Nice catch, ill put your findings into the top post
     
  13. SARWAN

    SARWAN

    Joined:
    Oct 23, 2012
    Posts:
    11

    How to solve this serialisation issue???
     
  14. SARWAN

    SARWAN

    Joined:
    Oct 23, 2012
    Posts:
    11
    I am still getting this error. Currently i'm using 4.5.2. I tried patch 1 & UNITY 4.5 but, no use.
    Any Ideas anyone?
     
  15. Okari-Draconis

    Okari-Draconis

    Joined:
    Sep 2, 2013
    Posts:
    21
    Are you using multi generic, generics?
    I had classes inhareted from generics that were defening generics within them selves that were passing generics from the inhartiting cladd