Can´t load objects from AssetBundles after update to Unity 2017.3

  1. Upgraded from Unity 2017.2.0f3 to 2017.3.0f3

Result:
The game works fine in Editor.

Build the game for Android. Bang! All objects instantiated from streaming Asset Bundles are way off, wrong sizes, rotations and mixed up textures when played on the device (Android 8.0).

  1. Rebuild the streaming assets for Android with
BuildPipeline.BuildAssetBundles ("Assets/StreamingAssets/Android", BuildAssetBundleOptions.None, BuildTarget.Android);

Result:
The game works fine, again when built for Android, yes!.

BUT
Now the editor crashes when I try to run the app in Editor.

The error dialog message ”Fatal Error!
The file ’archive:/CAB- a4b7c18….’ is corrupted!
Remove it and launch unity again!
[Positions out of bounds!]
UnityEngine.AssetBundle:LoadAssets(String)…"

and a reference to the script and the line where the object should be instantiated from the loaded AssetBundle

GameObject avatarPrefab = resourcesAssetBundle.LoadAsset<GameObject>(avatarPrefabName);

The only option is to Quit and relaunch Unity Editor.

Have tryed to build the assetbundles for BuildTarget.StandaloneOSX, with the same error message on instatiating in the Unity Editor (on Mac OS X 10.12).

Is there a better way to solve this than downgrade to Unity 2017.2 to build the Streaming Assets for Editor, and use Unity 2017.3 to build them for Android?

3340259--260750--fatal_error.png

1 Like

Unity 2017.3.0f3 on Windows 10 throws the same error message, and forces the Editor to quit (no problem in 2017.2).

Does loading of selected objects from Assetbundles by name work for anyone else?

3340943--260820--fatal_error_win.png

Are you building assetbundles for Android and for Windows? Or is your Editor set to Android and you’re just building one set of bundles?

No issues with bundles for us currently that I can see.

Just assetbundles for Android, and the platform is set to Android in Editor.

Just ran into the same issue.

All bundles work fine on android but some of them crash in the editor
I’m still trying to figure out what is causing this strange corruption…

I was able to get rid of this error by adding the flag: DisableWriteTypeTree
To my AssetBundle build pipeline

Then I can´t load the asset bundle at all (so it stops before trying to load objects from the bundle)…

This is the new error message:
“The AssetBundle ‘resources’ could not be loaded because it contains run-time classes of incompatible version. Rebuild the AssetBundle to fix this error.”

(No problems logged during the build of the AssetBundle with the option BuildAssetBundleOptions.DisableWriteTypeTree)

Hi arfish,

I also had this error after added DisableWriteTypeTree to my build pipeline (see this post )

One of my assets was causing the message:
“The AssetBundle ‘somebundle’ could not be loaded because it contains run-time classes of incompatible version. Rebuild the AssetBundle to fix this error.”

It was a mesh. And changing the import option “Mesh Compression” of the mesh to “Off” fixed the issue for me.

Correct me if I’m wrong but I think this error should only pop if you build your assetBundle with a different unity version that the one loading it.

All thoses issues were produce with 2017.3.
2017.2 work just fine.

It´s like the Editor in 2017.3 expects AssetBundles built with 2017.2 or earlier.

For now I use an older copy of the AssetBundle when running the game in Editor, but it´s tricky to debug network games when the same code can´t run in both Editor and a device, using the Editor as one network client.

Kind of hoping for a bug fix from the Unity dev team.

I’ve got the same problem, but the other way round. Everything runs fine in the Editor but the error message occurs on the platform. Will try the DisableWriteTypeTree option and if that doesn’t help I will go back to 2017.2 probably. By the way, I was able to reduce the amount of error messages thrown by setting the Mesh compression of some files to “Medium” (they were set to off before), but it doesn’t help to get rid of the problem in general.

I just couldn´t keep banging my head in 2017.3, so I´m forced back to 2017.2 for now. Though I miss the Video render from 2017.3, it ran realy smooth.

Make sure you report it as a bug. However, I would say just for testing, you might try using the build option built into the assetbundle browser. If this works, then it may be some other issue. Perhaps the way you were building the bundles changed for 2017.3. Just a thought though.

In addition to filing a bug report, which is a great idea if you’ve done all you can think of, is to check the patch release page to see if any of the 2017.3 patches have your issue listed as fixed (or the issue tracker, if you can find it easily). :slight_smile:

Yeah, it´s reported as a bug with an enclosed project and Asset Bundle to reproduce the errors.
No fix for it yet in 2017.3.0p1, p2, nor p3.

I bumped in to a related error while running the build from 2017.3 on a Android 6.0 device. Some of my objects from 2017.3 bundles rendereds in wrong positons, and another bundle crashed the 6.0 device, and this build was running fine in Android 8.0. There must be something going on with the bundles, no errors logged though. All fine again when back in 2017.2…

Cool, hopefully they fix it with the bug report, then. :slight_smile:

I ended up downgrading to 2017.2 and the error was gone. However, it turned out that there was a bug on my end as well, loading files from the asset bundle before it finished loading, which caused some out of memory errors. As I thought that this might have been the same bug with a different appearance in 2017.3 I tried it one more time but without any luck. So until further notice I will stick with 2017.2

I have the same problem, I switch the mesh compresion from off to medium and worked!

Using unity 2017.3

Hello,

I have update my project from unity 5.2.5 to Unity 2017.3 and after resolving all errors. When I try to run my game and try load asset bundle from my local directory it freezes. Basically AssetBundleRequest.isDone is always fine. My code is working fine in unity 5.2.5 and now I am unable to understand what happening here. I have build asset bundle with unity 2017.3 still its not working.

  • LoadedAssetBundle bundle = AssetBundleManager.GetLoadedAssetBundle (m_AssetBundleName, out m_DownloadingError);
  • if(string.IsNullOrEmpty(m_DownloadingError) == false)
  • {
  • Debug.LogError("Asset bundle download error: " + m_AssetBundleName + " - " + m_DownloadingError);
  • return false;
  • }
  • if (bundle != null)
  • {
    • m_Request = bundle.m_AssetBundle.LoadAssetAsync (m_AssetName, m_Type);
  • Debug.Log (m_Request + " " + m_Request.isDone);
  • if (m_Request != null && m_Request.isDone)
  • {
  • AssetBundleManager.AssetBundleManifestObject = GetAsset();
  • return false;
  • }
  • }
  • return true;

Did you ever resolve this? I’m having possibly a similar issue with 2018.2.1f1.

I stayed with 2017.2 for a while. It seems ok now in 2018.2.3f1, and 2018.2.5f.
Have only tested 2018.2.5f with Android 8.0, but 2018.2.3f1 was ok in Android 6.0 too.

1 Like