Forums › 💬 NodeCanvas › ⚙️ Support › Unable to Export Prefabs
When using Spatial OS and NodeCanvas getting this Error.. Pretty sure it has something to do with an editor script trying to go with the prefab…
Full Error:
Inconsistent asset when sorting preload assets: ” fileID: 0
UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)
Improbable.Unity.EditorTools.PrefabExport.EntityPrefabExporter:ExportAllNamedPrefabs(BuildTarget) (at Assets/Plugins/Improbable/Sdk/Src/Editor/PrefabExport/EntityPrefabExporter.cs:155)
Improbable.Unity.EditorTools.PrefabExport.EntityPrefabExporter:ExportEntityPrefabs(IEnumerable`1, BuildTarget) (at Assets/Plugins/Improbable/Sdk/Src/Editor/PrefabExport/EntityPrefabExporter.cs:55)
Improbable.Unity.EditorTools.PrefabExport.EntityPrefabExporter:ExportEntityPrefabs(IEnumerable1, IEnumerable1) (at Assets/Plugins/Improbable/Sdk/Src/Editor/PrefabExport/EntityPrefabExporter.cs:40)
Improbable.Unity.EditorTools.PrefabExport.EntityPrefabExporter:ExportAllEntityPrefabs(BuildTarget) (at Assets/Plugins/Improbable/Sdk/Src/Editor/PrefabExport/EntityPrefabExporter.cs:67)
Improbable.Editor.Addons.SpatialBuild.SpatialBuild:ExportPrefabs() (at Assets/Plugins/Improbable/Sdk/Src/Editor/Editor/SpatialBuild/SpatialBuild.cs:219)
Improbable.Editor.Addons.SpatialBuild.SpatialBuild:OnDevGui(Rect) (at Assets/Plugins/Improbable/Sdk/Src/Editor/Editor/SpatialBuild/SpatialBuild.cs:110)
Improbable.Unity.Editor.Core.SpatialOsAuxWindow:OnGUI() (at Assets/Plugins/Improbable/Sdk/Src/Editor/Core/SpatialOsAuxWindow.cs:115)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Added another a few more screenshots of a log that might help since i was unable to upload a .log file.
Hello,
So, after checking this out in a clean project and building a bundle out of a prefab, I found the issue related to the error Inconsistent asset when sorting preload assets: ” fileID: 0. Even though the problem does not seem to affect the asset building, it is still annoying.
Within GraphOwner.OnValidate method and line #288, for editor convenience and to preload bound graphs even when the object is a prefab, I create an instance of the bound graph and set it’s HideFlags to HideFlags.HideAndDontSave, (which is actually also recommended by Unity by the way).
It seems though, that Unity don’t like this when building asset bundles due to the graph reference being a ‘TypeMismatch’ (which in general is not a problem).
[attachment file=”TypeMismatch.png”]
Thus, if we change line #288 to set the HideFlags to HideFlags.None, asset bundles will be created without the fileID: 0 error (or any error at all from my tests). The only downside of doing this change, is that bound graphs on prefab GraphOwners, will not be pre-loaded, and thus I will need to find another way to pre-load them, probably in the GraphOwnerInspector.OnEnable instead of in OnValidate.
Can you please give it a try and change GraphOwner.OnValidate at line #288 to this: boundGraphInstance.hideFlags = HideFlags.None; just to confirm you are able to build asset bundle without this error?
Thank you!
So I made the change you asked and it did remove the warnings but… Still unable to do a local launch.
Included all the good info from the logs.
Thanks for looking into this 🙂
Hello again,
Can you please clarify what these logs are (come from) more specifically?
Are there any steps I can take to reproduce these errors you are facing?
Can you please also share a bit more information about your setup? What is the target platform and what Unity version are you using as well?
I am asking because as stated in my earlier post, I tried building an asset bundle out of prefab and I didn’t get any problems (except from the fixed one I’ve told earlier).
Thank you.
Unity Version: 2018.2.7f1 (64-bit)
Spatial Version 13.1.0 or 13.2.0 tried both.
Just testing locally currently on Windows.
Steps to reproduce:
1. Generate the Schema
2. Build Prefabs
3. Build Client / Worker
4. Do a local launch… This runs the server on your machine and lets you connect with the unity
These logs are from the Workers, they are physics only and handle the logic and calculations. The Client you build contains the game but the worker still needs the assets to do the physics calcs. But for whatever reason your files plugin files aren’t letting the workers load and they just fill the logs with that error spam. Normally the worker connects after you hit local launch and the world gets populated by the workers.
But yea 0 issues creating the prefabs now just the unable to load assembly. My guess is still some reference to a graph ending up in the prefab that tries to access the editor assembly that wouldn’t have been created / exist on the physics worker.
