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

Resources.Load Failing

Discussion in 'Editor & General Support' started by Andrew-Carvalho, Aug 25, 2021.

  1. Andrew-Carvalho

    Andrew-Carvalho

    Joined:
    Apr 22, 2013
    Posts:
    42
    I have a project that is currently using (for now) the resources folder to load some prefabs by path.

    We've hit an issue where every so often, usually immediately after booting up the Editor, the Resources.Load call will fail saying that the object to be Instantiated is null, even though the path is correct. If any file is reimported through the context menu, the issue goes away, though the solution is temporary and will come back after relaunching.

    I've never seen an issue with Resources not being packaged/resolved correctly before, so I'm a little confused as to what is happening. Possibly a coincidence, but this started after updating to the new Spine 4.0 runtime. I haven't tested builds yet, but the issue in Editor is causing a lot of slowdown for content creation.

    Has anyone ever run into this issue before?
     
  2. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    84
    I have reports of several people with Android devices failing on Resources.Load randomly! Not on iOS, not on Android in general but on some Android devices (mostly pixel devices) and I can't find the issue. In Exception Reporting I just see that resources.load<TextAsset(<correctpath>) returned null and so those people can't run the game. The game is deployed to google play store with an aab file... really strange...

    So it may be related to the same issue, but it is so strange because nor on google or here in forum I find anything about that - and I can't be the only one who is experiencing this...
     
  3. Jason-ZY

    Jason-ZY

    Joined:
    Mar 30, 2022
    Posts:
    1
    hi ody,have you ever find any resolution, im now experiencing this issue, Resources.Load<TextAsset>() return null in google aab while apk works fine, i use addressable to manage assets and the size of aab is more than 1gb
     
  4. odysoftware

    odysoftware

    Joined:
    Jul 21, 2015
    Posts:
    84
    Sadly no, what I did was that I have now removed the StreamingAsset content from the build and I am streaming it now myself via normal assetbundles download - since then I never had those issues again...