Giter VIP home page Giter VIP logo

Comments (3)

JohnBaracuda avatar JohnBaracuda commented on September 14, 2024

from com.baracuda.runtime-monitoring.

AldeRoberge avatar AldeRoberge commented on September 14, 2024

Hello John,

Thanks for the quick answer. I will try to launch Resources.LoadAll from a dummy script to see if it behaves the same.

I will update this comment when tests are completed.

Edit : Here's the result :

public class ResourcesLoadAll : MonoBehaviour { void Start() { var dummyCode = Resources.LoadAll<TextAsset>(string.Empty).FirstOrDefault(); Debug.Log($"Resources.LoadAll<TextAsset>(null) returned {dummyCode}"); } }

Output :

Autoconnected Player "Autoconnected Player" A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 52 bytes but expected 64 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

So your assumptions were absolutely right, when you said :

The tool appears prominently in the stack trace because it's the first to invoke a Resources.Load call. This call triggers the deserialization of all resource objects, and it seems that one or more of these objects has a mismatch in its serialized fields.

It seems like my debugging journey does not end here. Thank you for this awesome tool, and sorry for pointing towards it as the culprit.

If anyone has this problem in the future, here's a list of threads mentionning the issue :
https://forum.unity.com/threads/did-you-ifdef-unity_editor-a-section-of-your-serialized-properties.122639/
https://forum.unity.com/threads/did-you-ifdef-unity_editor-a-section-of-your-serialized-properties-in-any-of-your-scripts.298682/
https://discussions.unity.com/t/a-script-behaviour-has-a-different-serialization-layout/179172/8

I will update if I ever find what the problem was, since the above threads are from many years ago and provide little to no clue to what the issue is.

from com.baracuda.runtime-monitoring.

AldeRoberge avatar AldeRoberge commented on September 14, 2024

After many hours of debugging, I finally found the problem. It has nothing to do with Barracuda Runtime Monitoring, but here's the problem if anyone ever finds himself in this situation.

Error :

csharp "A scripted object (script unknown or not yet loaded) has a different serialization layout when loading. (Read 52 bytes but expected 64 bytes) Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?"

Setup :
IL2CPP, Unity 2022.3.10f1 (Platforms : Windows and Android)

After manually using the "binary search algoritm",
I traced back the error to HurricaneVR after 3 full days of debugging, and I'm baffled no one else is having this problem.

image

I deleted all 3 resources folder and found the culprit : It IS because of the Assets/Plugins/HurricaneVR/Framework/Resources
Then I kept deleting and building, until I found that It IS because of the HVREditorPreferences file in the Resources folder.

Problem : HVREditorPreferences.asset is in the Resources folder (INCLUDED IN BUILD) (Assets/Plugins/HurricaneVR/Framework/Resources) but the file is in (Assets/Plugins/HurricaneVR/Framework/Editor/HVREditorPreferences.cs) (NOT INCLUDED IN BUILD).

This closes this issue, and hoping no one ever has to deal with this problem ever again. I'll file a report with Unity so that they provide more information on the debug log. Makes me wish I was using an open source engine, and with the turmoil of the current days, I might do that for my next project.

from com.baracuda.runtime-monitoring.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.