I’m getting the following errors while trying to build the addressables:
1:
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: ‘Library/unity default resources’
Included from scene: ‘Assets/Scenes/MainMenuScene.unity’
Asset name: GUISkin
(You are probably referencing internal Unity data in your build.)
UnityEditor.GenericMenu:CatchMenu (object,string[ ],int)
2:
Build Task WriteSerializedFiles failed with exception:
Could not find file “C:\Users\anton\Documents\Repository\src\Library\BuildCache\09\09ce8b0817aa172c31c2406eb8cb0d48\8d13ef0b72bb794afb62efa3c0f57ec8\CAB-a454b013b8e1832c5df47a3870b9e2ef”
at System.IO.FileStream…ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.IO.FileStream…ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at System.IO.FileStream…ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream…ctor(string,System.IO.FileMode,System.IO.FileAccess)
at UnityEditor.Build.Pipeline.Utilities.HashingMethods.CalculateFile (System.String filePath) [0x00000] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Utilities\HashingMethods.cs:488
at UnityEditor.Build.Pipeline.Tasks.WriteSerializedFiles.CalculateFileMetadata (UnityEditor.Build.Content.WriteResult& result) [0x0002f] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Tasks\WriteSerializedFiles.cs:134
at UnityEditor.Build.Pipeline.Tasks.WriteSerializedFiles.UnityEditor.Build.Pipeline.Utilities.TaskCachingUtility.IRunCachedCallbacks<UnityEditor.Build.Pipeline.Tasks.WriteSerializedFiles.Item>.ProcessUncached (UnityEditor.Build.Pipeline.Utilities.TaskCachingUtility+WorkItem1[T] item) [0x000bb] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Tasks\WriteSerializedFiles.cs:178 at UnityEditor.Build.Pipeline.Utilities.TaskCachingUtility.RunCachedOperation[T] (UnityEditor.Build.Pipeline.Interfaces.IBuildCache cache, UnityEditor.Build.Pipeline.Interfaces.IBuildLogger log, UnityEditor.Build.Pipeline.Interfaces.IProgressTracker tracker, System.Collections.Generic.List
1[T] workItems, UnityEditor.Build.Pipeline.Utilities.TaskCachingUtility+IRunCachedCallbacks1[T] cbs) [0x00177] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Utilities\TaskCachingUtility.cs:100 at UnityEditor.Build.Pipeline.Tasks.WriteSerializedFiles.Run () [0x0003b] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Tasks\WriteSerializedFiles.cs:120 at UnityEditor.Build.Pipeline.BuildTasksRunner.Run (System.Collections.Generic.IList
1[T] pipeline, UnityEditor.Build.Pipeline.Interfaces.IBuildContext context) [0x00099] in C:\Users\anton\Documents\Repository\src\Library\PackageCache\com.unity.scriptablebuildpipeline@1.19.2\Editor\Shared\BuildTasksRunner.cs:56
UnityEditor.GenericMenu:CatchMenu (object,string[ ],int)
3:
SBP ErrorException
UnityEditor.GenericMenu:CatchMenu (object,string[ ],int)
4:
Addressable content build failure (duration : 0:01:37.412)
UnityEditor.GenericMenu:CatchMenu (object,string[ ],int)
Things i have tried so far:
1- Deleting the mentioned ‘Assets/Scenes/MainMenuScene.unity’ scene, doesn’t fix the issue as after trying to build the game without the scene the same error happens but referencing another scene.
2- Making sure none of my scripts has the “using UnityEditor;” directive (anywhere i use it in my script is also between “#if UNITY_EDITOR” and “#endif”.
3- Deleting the Library folder.
4- Reimporting the Assets folder.
5- Enabling/Disabling MonoScript Bundle Naming, as well as trying all the different options in that.
6- Enabling/Disabling Non-Recursive Dependency Calculation.
7- Also tried out all the options on the Shader Naming.
Also worth noticing:
1- Disabling MonoScript Bundle Naming makes it so no error is thrown during the addressables building process, however it makes any kind of addressable files completely broken inside game builds (works fine in editor play mode), the first scene works fine in standalone builds since it’s not an addressable, however any scene after that is broken and full of errors.
2- In the editor, changing Play Mode Scripts to advanced makes the game work fine, however using “Existing Build” (if MonoScript Bundle Naming is disabled - since while enabled it throws the above error) makes the game completely broken as well, only the starting scene works since it’s not an addressable.
3- I can’t reproduce the issue since it’s a very large project.
4- I can’t attach the project since it’s very large.
5- I have been using addressables for over an year and i have never experienced such problem, the problem didn’t appear after updating the Addressables package.
6- I was experiencing this issue in the 1.18.15 version, upgraded to 1.19.4 but that did not fix the problem.
Current Addressables package version: 1.19.4
Current Unity Version: 2020.3.18f1