Beware of Unity iOS stripping settings

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Beware of Unity iOS stripping settings

Postby ThomasLund » 21 Mar 2012, 11:08

In my own next game we just had a issue with connecting to the SFS server.

In case anyone else runs into the same, here is the problem and solution.

Problem:
Our game uses our own turn-based framework that sits between the scripts in Unity and Unity+SFS. Its compiled out as separate DLL files, and its in here that we got all SFS code embedded.

So our game scripts -> framework dll -> SFS dll

When deploying the game to iOS and trying to connect we got this weird exception:

Code: Select all

[SFS - ERROR] TCPSocketLayer: General exception on connection: An exception was thrown by the type initializer for System.Net.Sockets.Socket   at System.Net.Sockets.TcpClient.Init (AddressFamily family) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.TcpClient..ctor () [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0
On Connection callback got: False (error : <General exception on connection: An exception was thrown by the type initializer for System.Net.Sockets.Socket   at System.Net.Sockets.TcpClient.Init (AddressFamily family) [0x00000] in <filename unknown>:0
  at System.Net.Sockets.TcpClient..ctor () [0x00000] in <filename unknown>:0
  at Sfs2X.Core.Sockets.TCPSocketLayer.ConnectThread () [0x00000] in <filename unknown>:0 >)


It turns out that we had stripping set to "Strip Assemblies". Since the game code itself never used TCPClient, those classes got stripped out.

So in case you ever have this issue, then one solution is to set stripping to none. Alternatively you can start adding things to the link.xml file explained here:

http://unity3d.com/support/documentatio ... ation.html

Hopefully this saves someone half a day of debugging sometime

/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
bjsion
Posts: 16
Joined: 02 May 2011, 12:39
Contact:

Re: Beware of Unity iOS stripping settings

Postby bjsion » 17 Jul 2013, 03:29

Hi Thomas,

Apologies for reviving an old thread, but my question really relates to this.

I am attempting to use the stripping option when compiling my Unity project for iOS. I am aware of the link.xml, but what I want to know is there if there is a list of dependency classes that are required by the SmartFox2(X).dll that should be included in this file?

Something like this would be very helpful.

Thanks in advance.

Cheers,
Ben
Eser Telekom
Posts: 25
Joined: 16 Oct 2014, 07:28
Location: Istanbul
Contact:

Re: Beware of Unity iOS stripping settings

Postby Eser Telekom » 11 Dec 2014, 10:24

Same Error occur in Android S4 . I fixed this problem with set to stripping level "Disabled".
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Beware of Unity iOS stripping settings

Postby Lapo » 11 Dec 2014, 18:30

Thanks for reporting.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 44 guests