Reputation: 4280
What I have found out so far
I am using C# and Unity to make a simple game. When I try and build this game for Android I get this error:
Error building Player: SystemException: 'System.Net.Sockets' are supported only with Unity Android Pro. Referenced from assembly 'Mono.Data.Tds'.
What this is saying is that I need to buy the Android Pro Licence to build a game with System.Net.Sockets
used in it. This confused me at first because I did not remember using System.Net.Sockets
at all. After some research I discovered that using
to broad of a scope in a Unity C# project causes this error, in my case I was doing:
using System;
Which by proxy included System.Net.Sockets
making Unity think I was using it.
The Issue
I am now using some open source library's in my game. When I went to build for Android after implementing these library's I got the same error. I then proceded to look at the source code for these library's and it seams that in every file the author(s) do:
using System;
Which was the cause of the error in the first part. These library's also do not make use of System.Net.Sockets
but suffer from using
to broad of a scope.
The question
Is there some way to have Unity recognize that I am not actually using System.Net.Sockets
so it does not make me buy Android Pro?
Edit
After doing what @Roberto suggested I removed all my library's and then started adding them back in until I got the error. I have determined that Json.NET is the culprit and is doing something with System.Net.Sockets
. However when I search the source for 'System.Net.Sockets
' or 'Mono.Data.Tds
' there are no results.
Upvotes: 1
Views: 1105
Reputation: 11953
This is not right, adding using System
won't expand to System.Net.Sockets
. Doesn't make much sense and otherwise would make virtually every game impossible to run on Unity free.
The thing is your code or a plugin is using System.Net.Sockets
. It may be a library (dll) perhaps, but definitely something is using it.
You can test my claims by creating a new project with one script with using System
and see that you won't have problems; additionally you may want to create a new project and increasingly add the plugins you are using to check which one is using System.Net.Sockets
.
I just read that this was happening on Unity 3.5.6. Are you using this version? If so, can't you update to Unity 4? I'm using Unity 4 and I don't have this problem. There's also 3.5.7 to try.
Upvotes: 1