sta / websocket-sharp

A C# implementation of the WebSocket protocol client and server
http://sta.github.io/websocket-sharp
MIT License
5.68k stars 1.66k forks source link

iOS AOT failing? #27

Open tolmasky opened 10 years ago

tolmasky commented 10 years ago

The library is working fine in the Editor (purchased through Asset store), but I'm getting this when I build for iOS:

Cross compilation job websocket-sharp.dll failed. UnityEngine.UnityException: Failed AOT cross compiler: /Applications/Unity/Unity.app/Contents/BuildTargetTools/iPhonePlayer/mono-xcompiler --aot=full,asmonly,nodebug,ficall,static,outfile="websocket-sharp.dll.s" "websocket-sharp.dll" current dir : Temp/StagingArea/Data/Managed result file exists: True stdout: stderr:

at UnityEditor.MonoProcessUtility.RunMonoProcess (System.Diagnostics.Process process, System.String name, System.String resultingFile) [0x00000] in :0 at UnityEditor.MonoCrossCompile.CrossCompileAOT (BuildTarget target, System.String crossCompilerAbsolutePath, System.String assembliesAbsoluteDirectory, CrossCompileOptions crossCompileOptions, System.String input, System.String output, System.String additionalOptions) [0x00000] in :0 at UnityEditor.MonoCrossCompile+JobCompileAOT.ThreadPoolCallback (System.Object threadContext) [0x00000] in :0 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

tolmasky commented 10 years ago

Extra info: Unity version is 4.2.2f1

sk-ericso commented 10 years ago

Did you try to add the link.xml? http://docs.unity3d.com/Documentation/Manual/iphone-playerSizeOptimization.html

tolmasky commented 10 years ago

My apologies, I'm a little new to Mono development. Is there a list of all the WebSocket-sharp classes I should be including in this link.xml? I'd be happy to commit the link.xml back to the project after I construct it, just not 100% sure what to include in it.

tolmasky commented 10 years ago

Additionally, I appear to have stripping off so I'm not 100% sure if that's the cause (although turning stripping on does seem to give a new error so I'm sure I'll eventually need to do it).

sta commented 10 years ago

Hmm,,, How about api compatibility level to .NET API 2.0? (If you selected .NET 2.0 Subset)

methane commented 10 years ago

I've made stripped version of websocket-sharp for Unity on iOS/Android https://github.com/KLab/websocket-unitymobile

Changes are: