Building for Android when using Odin through the package manager generate an error

Issue #758 new
Sylvain V. created an issue

Hello,

We added Odin to a Unity package, as described here. This is needed because some of our own packages are dependent from Odin.

If the package is added localy to our Unity project, using “Add package from disk” in the package manager, it doesn’t cause any issues. But if the package is uploaded to a scoped registry and downloaded through the package manager, an error occurs when building for Android.

The error is the following :

InvalidOperationException: Failed to get PluginImporter for Library\PackageCache\com.ohrizon.odin@3.0.1\Plugins\Sirenix\Assemblies\NoEmitAndNoEditor\Sirenix.Serialization.dll
Sirenix.Serialization.Utilities.Editor.AssemblyImportSettingsUtilities.SetAssemblyImportSettings (UnityEditor.BuildTarget platform, System.String assemblyFilePath, System.Boolean includeInBuild, System.Boolean includeInEditor) (at X:/Repositories/sirenix-development/OdinSerializer/OdinSerializer/Utilities/Misc/AssemblyImportSettingsUtilities.cs:207)
Sirenix.Serialization.Utilities.Editor.AssemblyImportSettingsUtilities.SetAssemblyImportSettings (UnityEditor.BuildTarget platform, System.String assemblyFilePath, Sirenix.Serialization.Utilities.Editor.OdinAssemblyImportSettings importSettings) (at X:/Repositories/sirenix-development/OdinSerializer/OdinSerializer/Utilities/Misc/AssemblyImportSettingsUtilities.cs:169)
Sirenix.OdinInspector.Editor.AssemblyImportSettingsAutomation.ApplyImportSettings (UnityEditor.BuildTarget platform, System.String[] assemblyPaths, Sirenix.Serialization.Utilities.Editor.OdinAssemblyImportSettings importSettings) (at Library/PackageCache/com.ohrizon.odin@3.0.1/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs:112)
Sirenix.OdinInspector.Editor.AssemblyImportSettingsAutomation.ConfigureImportSettings () (at Library/PackageCache/com.ohrizon.odin@3.0.1/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs:98)
Sirenix.OdinInspector.Editor.AssemblyImportSettingsAutomation.UnityEditor.Build.IPreprocessBuildWithReport.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Library/PackageCache/com.ohrizon.odin@3.0.1/Plugins/Sirenix/Odin Inspector/Scripts/Editor/AssemblyImportSettingsAutomation.cs:120)
UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass15_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) (at <8c48e4bc2ff34638b69095cbb65e2e27>:0)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at <8c48e4bc2ff34638b69095cbb65e2e27>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

There is two different behaviour :

  • When using “build and run” the error is displayed and the apk is not built.
  • When using “build” the error is displayed and the apk is built.

We used the package system with Odin 2.1.6 and did not encountered this issue. The issue has been successfully reproduced with odin 3.0.1 and 3.0.4.

The issue has been reproduced with Unity 2020.2.6f1 and 2019.4.x, both installed on Windows 10.

“Editor Only Mode” is not enabled and can’t seem to be enabled when using a downloaded package. When trying to enable “Editor Only Mode” these errors are displayed :

I attached to this issue the Asset folder from the Unity project that holds Odin. If you want to reproduce the issue you will need your own unity package server.

Please let me know if you need more information!

Thanks :)

Comments (0)

  1. Log in to comment