0 votes
asked in Bug Report by
Just imported UMotion Pro 1.06 into an existing 64bit DX11 Net 3.5 project under Unity 2017.3.1 and when trying to open the UMotion editor window, I get the following error message:

TypeLoadException: Could not load type 'ΊΊΉΉΉΊΉΊΉΊΉΊΉΊΊΊΉΉΊΊΉΊΊΉΉΉΉΊΊΉΊΉΉΉΉΊΉΉΊΉΉΊΉΉΉΊΉ' from assembly 'UMotionEditor, Version=1.0.6628.27488, Culture=neutral, PublicKeyToken=null'.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

As always with dll assets, its hard to debug this myself and/or find problematic interplay with other assets like double defined types etc..I already tried switching to Net 4.6, after which the editor completely denies loading of the assembly, stating that it is broken.Of course, when creating a new project and only loading UMotion Pro into it, everything works fine.

Any ideas what I could try next to drill down on the problem? Are there any types defined globally in the assembly that I could check for in code from other assets? At least that was the cause of a similar problem I had with another dll asset in the past - so just a straw.

3 Answers

0 votes
answered by Expert (54.1k points)
 
Best answer

Hi,
I wanted to provide a new update on this topic with all the latest information I have related to this problem:

  • Make sure UMotion isn't installed into a Plugins folder (e.g. "Plugins/UMotionEditor/...").
  • Make sure there is no AssemblyInfo.cs file in your project. You can search for such a file using the search bar in Unity's project window. If you have such a file in your project, you can safely delete it. This file usually is compiled into a *.dll, delivering it as source file makes no sense and causes problems.
  • If you have compile errors in your script when you import UMotion for the first time you get a very similar exception that complains that Assembly-CSharp can not be loaded. Make sure to fix any compile errors in your scripts. After that, UMotion should load fine.
  • Try to restart your computer, maybe an internal Unity problem causes the plugins not to get loaded correctly.
  • If none of the above applies, open the console window and make sure that "Collapse" is enabled. Check all error messages that you get, maybe that provides a hint.

Best regards,
Peter 

commented ago by

I'm having a similar problem, but the folder is in the default location, and the AssemblyInfo.cs are coming from packages (progrids and package manager UI), so I can't delete them.

I'm using unity 2018.2b4 any workarounds to it ? I really don't know what can be causing problems here if I import it to a new project with those packages umotion works.

commented ago by Expert (54.1k points)

Hi,
thanks for your support request.

It's Ok and valid when a package has an AssemblyInfo.cs because packages are compiled into there own assembly (using assembly definition files).

I really don't know what can be causing problems here if I import it to a new project with those packages umotion works.

If it works in an empty project then the cause of this issue must be something inside the project where it doesn't work. If you want you can send me the project via the email support form and I can take a look at it. You can also try to copy your project and start removing things step by step (other assets, etc.) until everything is working again. The thing you deleted before its starts working is most probably the cause of this issue.

I'm sorry for the inconvenience.

Best regards,
Peter

commented ago by
It's quite a big project so it's hard to send it to you.

Everytime I open it I get greeted with 29 of these errors

TypeLoadException: Could not load type 'ΊΉΉΊΊΉΉΉΊΊΉΉΊΊΊΊΊΊΊΊΊΉΊΊΉΊΊΉΉΉΉΊΉΉΊΉΊΉΊΊΉΉΊΊΊΊΉ' from assembly 'UMotionEditor, Version=1.0.6708.29006, Culture=neutral, PublicKeyToken=null'.

I'm right now deleting some stuff I don't use to see if I can narrow the problem.

The actual editor seems to be working in "preview mode" but for example the animations in the demo scene don't play (even if I can use the clips or see them with the clip editor).
 Thank you.
commented ago by Expert (54.1k points)

It's quite a big project so it's hard to send it to you.

It might be possible to delete all scenes and 3D assets from the project to get its size down. It's also possible that you request a link to my Dropbox (via the email support form) if the project size exceeds 20 MB.

The actual editor seems to be working in "preview mode" but for example the animations in the demo scene don't play (even if I can use the clips or see them with the clip editor).

You mean if you scrub the time cursor or press play in the Clip Editor, the pose of the robots don't update accordingly in the scene view?

What have you deleted from your project that UMotion can be opened now?

Best regards,
Peter

0 votes
answered by Expert (54.1k points)

Hi,
thank you very much for your support request.

It looks like Unity can't load a class called "UMotionMainLogic" which is in a UMotion specific namespace.

I just did a few tests on what I could think of that might be causing the issue but wasn't successful in reproducing your problem.

 Are there any types defined globally in the assembly that I could check for in code from other assets? 

UMotion uses classes of Beebyte's Obfuscator asset. My guess was that maybe a different asset (also compiled as dll) might use the same classes thus producing a naming conflict. But that seems not to introduce problems (at least in my tests).

Switching to .Net 4.6 also worked in my tests. Switching to .Net 4.6 should not be necessary as UMotion is compiled against .Net 3.5, though.

Do you have other assets compiled as *.dll in your project? Could you try adding them to your empty project one after another to trace down if there is a conflict with one of these?

I'm sorry for the inconvenience.

Best regards,
Peter

commented by
Thanks for the fast response! No need to be sorry, since (in my experience) it's a fairly common problem with dll plugins in Unity. And frankly, after all these years, the guys at Unity are still not able to handle cases like these gracefully (which would be quite easy, at least regarding handling and the amount of error information given to the user) which finally made me avoid dll assets whenever I could.
But some assets are too valuable regarding a productive workflow to be ruled out, and actually UMotion ranks among those for me.

In situations like these I always try to switch to Net 4.6 since it sometimes gives more or different information on the actual problem which can help to identify what's going on.

Now comes the fun stuff. I went the extra mile and imported all dll assets present in the actual project into the test project as well, without leading to the problem. I just noticed that loading of the Clip Editor window took longer than usual the first time after all dll assets had been imported.
Going back to the actual project, it all of a sudden also works there. So my first guess is that loading the assembly in the test project successfully by the Net runtime fixed whatever was the problem in the actual project as well.

While leaving me with an uneasy feeling, it seems like I can go on with work right now. I'll post here again if the situation changes once more.

Thanks for your time, and best hopes for all of us that Unity will be able to get dll handling right one day in the near future.
commented by Expert (54.1k points)

Thanks for that detailed reply. That's really strange and indeed smells a little bit like a Unity "dll" loading bug.

No need to be sorry, since (in my experience) it's a fairly common problem with dll plugins in Unity.

Do you know some forum threads or the like of other problems like this one? Maybe I can find some parallels or maybe I can even get this reproduced (then I would be able to do some further debugging or sending a bug report to Unity).

While leaving me with an uneasy feeling, it seems like I can go on with work right now.

Yes that gives me the same feeling... Not reproduce-able problems that only appear randomly are the fear of every programmer I guess...

I'll post here again if the situation changes once more.

Yes, please keep me updated.

Best regards,
Peter

commented by

Hello, I encountered the same situation. After I deleted a lot of files, I found that there was a cs file that may have caused this problem. This file came from another third party plugin (Easy Movie Texture v3.59)

AssemblyInfo.cs:

using System.Reflection;

using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following 

// set of attributes. Change these attribute values to modify the information

// associated with an assembly.

[assembly: AssemblyTitle("FFmpeg.AutoGen")]

[assembly: AssemblyDescription("")]

[assembly: AssemblyConfiguration("")]

[assembly: AssemblyCompany("")]

[assembly: AssemblyProduct("FFmpeg.AutoGen")]

[assembly: AssemblyCopyright("Copyright © Ruslan Balanukhin 2015")]

[assembly: AssemblyTrademark("")]

[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 

// to COM components.  If you need to access a type in this assembly from 

// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("410c7abf-7c83-478f-8655-af2a0f29c7ff")]

// Version information for an assembly consists of the following four values:

//

//      Major Version

//      Minor Version 

//      Build Number

//      Revision

//

// You can specify all the values or you can default the Build and Revision Numbers 

// by using the '*' as shown below:

// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.2.0.0")]

[assembly: AssemblyFileVersion("1.2.0.0")]

My version of UMotion is 1.08

I have used the following version of unity:

2017.4.2f1

2017.3.1p1

2017.1.0p5

All have this problem

My mother tongue is not English. This reply comes from translation software. Please forgive me and hope to help you reproduce this problem.

commented by Expert (54.1k points)
Hi,
thank you very much for this very helpful information.

Can you reproduce this error if you create an empty project with just UMotion and the Movie Texture plugin included?

Thanks!

Best regards,
Peter
commented by
Yes, I did a new project and reproduced the problem. When I found AssemblyInfo.cs and deleted it, UMotion resumed operation. EasyMovieTexture also seems to have no other problems.
commented by Expert (54.1k points)
Thank you very much. I will take a look into this and keep you updated.

Best regards,
Peter
commented by Expert (54.1k points)
Hi Null,
I was in contact with the developer of "Easy Movie Texture". He was very helpful and will delete the AssemblyInfo.cs file from his asset. The AssemblyInfo.cs is already compiled into the *.dll so shipping it as source file is not correct and explains why things get messed up.

Thanks again for this very helpful tip!

Best regards,
Peter
0 votes
answered by Expert (54.1k points)
Hi,
I just wanted to let you know that I was able to reproduce this exception. You get this error when UMotion is installed into a Plugins folder (e.g. "Plugins/UMotionEditor/...").

UMotion is delivered with *.dll and *.cs files. When the *.cs files are located in a "Plugins" folder Unity compiles them in the first pass (--> they are added to "Assembly-CSharp-firstpass.dll"). But the UMotion *.dlls try to load the *.cs files from the "Assembly-CSharp.dll" which fails and produces the cryptic error message you've got.

Long story short: Please don't put the UMotion folder into a "Plugins" folder. I've implemented a meaningful error dialog that is shown instead of the cryptic exception that you discovered. This change ships in UMotion V1.08p01.

Again, thanks for reporting!

Best regards,
Peter
commented by
Thanks for getting back to me and I'm glad that my report was useful to sort that out.

Funny thing is, I never moved UMotion from its original install path, but meanwhile - while removing a couple of unused assets - I've identified another asset that also seemingly uses the Obfuscator asset. So maybe there was a very tangled code reference situation at works in my case, and Unity once again wasn't able to handle that gracefully (not bashing here, just talking about common reality).

Ah well, the magic of the ghost in the machine. Let's hope weve sorted that out completely at the time we start using completely autonomous machines in our every households. :)

Best regards and wishes for your projects,
Heiko

Soxware Support

Here you get official product support by the developer and the community for all Soxware Products for Unity®.

Post as guest, login via Facebook or create an account.

Ask questions, report bugs or provide feedback. Please use the correct category and always post in english.

For private email support, please use the Support Form to create a support ticket.

Copyright © 2017 Soxware Interactive | All Rights Reserved | Impressum

...