Sign In Register

How can we help you today?

Start a new topic
Solved

Error connection on android devices.

Hi there, 


We have integrated the Gamesprks in our game and we an issue with the android build, IOS, and desktop just works fine. we are building the game using unity and the Gamesparks plugin downloaded from your site. Here is how the case would happen with us : 


1.  Build while the option Stripping level is "Disabled", and the build goes fine and everything works, connecting to gamespark goes well.

2. Choose anything other than Disabled at the stripping level, and things will not function at all, gamespark keeps on trying to connect and it fails.


It seems like some classes have been removed while doing the stripping process but we were not able to identify them. Here is what I have tried to add to fix the problem but it didn't work :


* Added a file link.xml under the resources folder which includes the following :


 

<linker>
    <assembly fullname="System">
        <type fullname="System.Net.HttpRequestCreator" preserve="all"/>   
        <type fullname="System.Net.WebRequest" preserve="all"/> 
        <type fullname="System.Net.WebResponse" preserve="all"/> 
        <type fullname="System.Net.WebSockets.WebSocket" preserve="all"/> 
    </assembly>
</linker>

 

But still this didn't fix our issues.


Any help please ?



Hi Tareq,


If you modify the link.xml file to look like:

 

<linker>
  <assembly fullname="System">
    <namespace fullname="System.Net" preserve="all"/>
    <namespace fullname="System.Net.Configuration" preserve="all"/>
    <namespace fullname="System.ComponentModel" preserve="all"/>
    <namespace fullname="System.Runtime.ConstrainedExecution" preserve="all"/>
    <namespace fullname="System.Runtime.InteropServices" preserve="all"/>
    <namespace fullname="System.Runtime.Serialization" preserve="all"/>
    <namespace fullname="System.Configuration" preserve="all"/>
  </assembly>
  <assembly fullname="mscorlib">
    <namespace fullname="System.Security.Cryptography" preserve="all"/>
  </assembly>
  <assembly fullname="Mono.Security">
    <namespace fullname="Mono.Security.Protocol.Tls" preserve="all"/>
    <namespace fullname="Mono.Security.X509" preserve="all"/>
  </assembly>
</linker>

 


It should work, we will also be releasing an update soon which will fix the issue.


Shane

 It looks likes this is still an issue. I have Unity 5.2.3f1 and the latest link.xml. With stripping enabled it cannot connect on an android device, though it works fine in the unity editor.


1 person likes this

We're also having the same issue with Android and stripping levels on Unity 5.6, Our link.xml looks the same as the one Shane posted above but Android can't connect. I guess the only working solution for now is to disable stripping entirely.

Do I need to do something special for Unity ./ Android ? When I run in the Unity Editor, I'm able to connect. On Android it fails. I added the lines to the manifest:

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.INTERNET" />

But still no go...

Anyone have any ideas?

Thanks,
Andrew

 

Login to post a comment