Tagged: Unity build problem
- 27/05/2014 at 17:53 #1053
I followed the instruction to download and install the REX dev kit with the EyeX SDK and Unity. The calibration works fine and I can load the example code in Unity (and run the demo scenes). However when I compile the existing code (even before modification from me) I get the following 4 errors (same on 2 different computers) :
Error Error: System.BadImageFormatException: Could not load file or assembly ‘UnitySamples\Assets\Plugins\Tobii.EyeX.Client.Net20.dll’ or one of its dependencies. An attempt was made to load a program with an incorrect format. (Error: System.BadImageFormatException) (Assembly-UnityScript-firstpass)
Error File name: ‘\UnitySamples\Assets\Plugins\Tobii.EyeX.Client.Net20.dll’ (File name) (Assembly-UnityScript-firstpass)
Error WRN: Assembly binding logging is turned OFF. (WRN) (Assembly-UnityScript-firstpass)
Error Note: There is some performance penalty associated with assembly bind failure logging. (Note) (Assembly-UnityScript-firstpass)
More surprising it seems that my compiling somehow works because I can still run the scenes (I tried small code modifications to be sure and it actually takes the modifications into account).
Should I work like this ?28/05/2014 at 19:31 #1063AndersParticipant
Unity creates two solution files for you, one called UnitySamples.sln and one called UnitySamples-csharp.sln. The difference between the two is that the one without the “csharp” includes ALL script code projects, not just the ones for C#. And the project that fails with the errrors you describe happens to be one written in UnityScript. So the easy fix is to use the “csharp” solution file instead: no errors, everybody happy! 🙂
The reason for the error is that Unity:
a) adds assemblies in the plugin directory as references to ALL script code projects, not only the ones written in C#.
b) expects the assemblies referenced from the UnityScript assembly to be compiled for Any CPU, but the Tobii.EyeX.Client.Net20 assembly is compiled for the x86 platform (the SDK package also includes one for x64).
An alternative solution to the problem is to remove the reference to Tobii.EyeX.Client.Net20 from the UnityScript project. But Unity will probably insist on putting it back there every time the project file is re-generated.28/05/2014 at 19:49 #1065
Thank you for your answer and this explanation!
I tried a few things but I am not too sure about what to do exactly when you say the solution is to “use the “csharp” solution file instead”. Do you mean compiling in mono in a different manner ? Or is it an option to choose before compiling ?
Thanks a lot !29/05/2014 at 13:07 #1068AndersParticipant
you can open and work with the UnityProject-csharp.sln solution file in MonoDevelop instead of the UnityProject.sln file. Just use File/Open and browse for it.29/05/2014 at 16:47 #1071
Thanks a lot for your quick answer. Very clear, it solved most of it. I still had one error : “\UnitySamples\Assets\Scripts\EyeX\EyeXHost.cs(17,17): Error CS1501: No overload for method ‘Shutdown’ takes ‘0’ arguments (CS1501) (Assembly-CSharp-vs)”
I deactivated the following part in the code and it works but I guess it’s not a very safe option :
if (_context != null)
// attempt to shut down the context nicely before disposing it.
catch (InteractionApiException ex)
print(“EyeX context shutdown failed: ” + ex.Message);
_context = null;
}02/06/2014 at 08:13 #1078Robert [Tobii]Participant
The method takes two arguments, but should use default parameters if invoked without arguments. Instead of commenting out the code, you can try to call Shutdown with the default arguments.
I hope that solves the problem. We will fix it in the next version of the EyeX SDK for Unity.
- You must be logged in to reply to this topic.