0
votes

I am working on android application on unity3d 5.3.5 I haven't faced any problem building my application to apk. I added the windows module and switched the project to windows and built the project successfully. I switched back to android and when I tried to build the project, I get the errors:

  • Error building Player: ReflectionTypeLoadException: The classes in the module cannot be loaded.

  • ReflectionTypeLoadException: The classes in the module cannot be loaded. System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:371) UnityEditor.AttributeHelper+c__Iterator31[System.Collections.Generic.IEnumerable1[UnityEditorInternal.PluginDesc]].MoveNext () (at C:/buildslave/unity/build/Editor/Mono/AttributeHelper.cs:277) UnityEditor.PluginImporter+c__Iterator0.MoveNext () (at C:/buildslave/unity/build/artifacts/generated/common/editor/PluginImporterBindings.gen.cs:123) UnityEditor.Android.PostProcessAndroidPlayer.PreparePlugins (System.String stagingArea, System.String targetLibrariesFolder) UnityEditor.Android.PostProcessAndroidPlayer.PostProcessInternal (System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:316) UnityEditor.HostView:OnGUI().

Beside the error I get the unity message in console :

  • SpritePacker failed to get types from UnityEditor.OSXStandalone.Extensions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. Error: The classes in the module cannot be loaded. UnityEditor.HostView:OnGUI()

I added multiple scripts and assets to the project before building.

I get the same errors on different projects.

Any ideas on this issue?

1
Close and reopen the Unity Editor. It appears that it may be in OSX mode instead of Android? Switch it back to Android again. Does switching from .Net 2.0 Subset to .Net 2.0 (full) help? - Gandalf458
I have this problem 2 days ago. I tried reopening the editor, restarting PC, and switching to windows and back to android again. I tried switchng from .Net 2.0 Subset to .Net 2.0 as well. - Jaz

1 Answers

0
votes

After hours of searching, I couldn't come up with a solution other than reinstalling Unity.

I reinstalled Unity with Android module only. Things are back to normal again.

As I suspected, looks like the issue occurred after installing Windows Module.