I posted already in the General support forum, but I think this is a better place for this problem. Sorry for reposting.
We are using Asset Bundles since Unity 5.2. We have a custom build pipeline (NOT the Unity provided tools from bitbucket or the browser tool from the asset store) in place which was working fine until we switched from 5.6.1 to Unity 2017.1 yesterday (or 5.6.2 today - same problem). We changed nothing in our asset bundle codebase.
Scriptable object assets and prefabs with scripts are a problem because Unity couldnāt find the scripts when loaded from an asset bundle. We get messages like āThe referenced script on this Behaviour is missing!ā or āThe file ānoneā is corrupted! Remove it and launch unity again!ā.
The assets are fine in the editor. Itās just a problem if we put the assets in asset bundles. The files are in the asset bundles if you look at the manifest file.
Our workaround is to go back to Unity 5.6.1 for now.
Has anyone else similar problems and maybe a solution?
Hey @Tuni
Itās a known bug that we just recently fixed. It should be fixed in 2017.1f3 so make sure your 2017.1 install is fully up to date. If you are still getting that issue, please submit a bug report with a repro project.
Ok, so there is one more issue Iāve seen recently that produces the same error msg. That is if you have a Prefab with a reference to a child object of another Prefab. For example prefab layout would look like this:
Prefab 1 w/ MonoBehavior
Child 1
Prefab 2 w/ MonoBehavior that has an object reference to Child 1
This issue though we donāt have a fix just yet for it however are working to resolve it.
I found another issue and a workaround for us. We load scriptable objects (will call it SO from here on) with LoadAllAssets(). This creates the same warning / error messages. LoadAsset() doesnāt work correctly after this (at least for short period of time).
I uploaded a very basic project with 2017.1f3. Case 930819. This project contains a simple script which loads a SO and a prefab from an asset bundle in the StreamingAssets folder.
Our workaround: We created a SO which only holds an array with references to all the other SO and load this with LoadAsset() instead all SO with LoadAllAssets().
Hey Tuni,
Iāve got a fix for that case you submitted going through the PR process now. Great repro steps and project, made is super easy to track down. Thanks!
Pretty happy you guys are fast working into the issue, i was about to recreate all my pipeline thinking i changed something before upgrading. This need to be patched ASAP, it is game-dev stopping for me.
Ok, so the fix has gone through PR and been merged into 2017.3.0a4, and 2017.2.0b7. Itās currently going through the merge process for 2017.1; it should be in 2017.1.0p4 if nothing critical happens. As for 5.5 & 5.6, Iām still in queue waiting, so wonāt know more until it gets past approval.
@Leoo
I donāt have an exact eta for the 2017.1.0p4 release. Typically patches come out weekly to bi-weekly for the most recent Unity release and the latest path release (2017.1.0p2) was on 7/27.
Well, I found the new path version updated for 5.6.3p1
But the update information is just one: Fixed Security Vulnerability UNITY-SEC-844
Has this bug been fixed?
This is the downside to stating which patch it is in before itās released. Sorry all, the security update takes priority and bumped all fixes going out. It looks like the answer is a mixed bag, some unity versions will still have this fix patched in the same release time frame (and just be called the next patch number instead) and some have had their release delayed. In 5.6ās case, the fix will now be in 5.6.3p2 and it was delayed slightly.
Looks like Unity is not even trying, been stuck for long time with the 5.6.1p2, any version after that is broken, and 5.6.1p2 has many issues, like tapjacking causing problem to users. How long does Unity pretend to keep us without an stability patch? This should be highest priority, without this, anyone who rely on the assetbundle system is unable to update. Iāll take this into consideration next time Iām ask to put my vote on using assetbundleās system from Unity.
In my perspective, such blocking issue should be priority. Why would you patch things that users will not be able to use since they canāt even upgrade?
If you need a work around for this issue, you can use the OfType to cast and return the values from LoadAllAssets and not trigger the bug. For Example:
GameObject[ ] results = myBundle.LoadAllAssets(); // Will trigger the bug
GameObject[ ] results = myBundle.LoadAllAssets().OfType().ToArray(); // Will not trigger the bug
Another option is to write an extension method. Then when the bug is fixed, you can just update this method instead of having to change code all over the place.
public static T[ ] LoadAllAssetsFix(this UnityEngine.AssetBundle bundle)
{
return bundle.LoadAllAssets().OfType().ToArray();
}
I have update a project which is in unity 5.2.5 to unity 2017.3 p4. I have create my assetbundle from the same version as well as still I am unable to load assetbundle. Basically m_Request.isDone never gets true, I am always getting false in logs. @Ryan-Unity Can you plz help.
Here is the code :
LoadedAssetBundle bundle = AssetBundleManager.GetLoadedAssetBundle (m_AssetBundleName, out m_DownloadingError);
What I found is , m_Request.isDone never getting true. In unity 5.2.5 this code works fine and got true but after updating its not working. Please Help !!!