0

In order to be able to submit again to the app store (for a published game) we had to make things work for IPv6. So we updated Unity to the version 5.3.5p2 (latest patched version available)

We went through reworking all our networking interfaces (we used to use classic http requests for backend server com and socket connections for asset download) we swapped everything with UnityWebRequest, DownloadHandler and UploadHandler from UnityEngine.Experimental.Networking

Everything works fine on Editor and android but for iOS it just ... crashes.

We are using : Unity 5.3.5p2 xCode 7.2 and iPad2 with iOS 9.3.2 Build settings : IL2CPP Universal Architecture (min iOS 7.1) API Level .Net 2.0 Strip Engine code set to OFF AOT-Compile options set to : mint-trampoline 512 (we were using this for mono scripting backend) On Xcode : Bitcode is disabled optimisation level set to (for release and debug) : None[-O0] Here is the error we get on console when the game runs :

Unable to find method GetProgress in [UnityEngine.dll]UnityEngine.Experimental.Networking.DownloadHandler . . Unable to find method ReceiveContentLength in [UnityEngine.dll]UnityEngine.Experimental.Networking.DownloadHandler . . [project name] was compiled with optimization - stepping may behave oddly; variables may not be available.

(we very simply implemented the DownloadHandlerScript with a managed static buffer)

When we build with mono as scripting backend things work fine. But IL2CPP is mandatory for us. Thank you for your help.

beQr
  • 503
  • 1
  • 4
  • 8

2 Answers2

0

When we build with mono as scripting backend things work fine. But IL2CPP is mandatory for us.

It is very likely that a function you are calling from UnityWebRequest is not yet implemented in the IL2CPP side or that is a plain bug.

Notice that you are using UnityWebRequest from UnityEngine.Experimental namespace which is clearly an experimental version of UnityWebRequest that is not yet mature. You need to download the latest version of Unity which is Unity 5.4. In 5.4, UnityWebRequest is moved to UnityEngine.Networking namespace and more bugs were fixed in that new release. Download Unity's 5.4.0b21 here.

If that doesn't work, use the Unity WWW API instead of UnityWebRequest. It is IPv6 safe in >= 5.3 versions. Also file for bug report if UnityWebRequest didn't work after updating Unity to 5.4.

Programmer
  • 121,791
  • 22
  • 236
  • 328
  • I don't think that this is unimplemented code in IL2CPP, but it may indeed be a bug on the Unity side. – Josh Peterson Jun 09 '16 at 11:41
  • @JoshPeterson Good to hear from a Unity Engineer. The post you made shows that it might be a stripping problem. I remember having similar problem few years ago when I tried to use the standard C# mail class to send email. If this ends up to be the problem, why don't Unity detect imported namespaces and used standard classes/API from each script then then automatically remove the stripping that is preventing this to work? This would save so much time for programmers. If this turns up to be a stripping problem, there would be lots and lots of unnecessary bug reports on this very soon. – Programmer Jun 09 '16 at 12:35
  • I think that problem with the mail class has been corrected, actually. We do to try correct any stripping problems related to the class libraries or UnityEngine code, so if this does end up being such a problem, we will look to correct it. – Josh Peterson Jun 09 '16 at 14:10
  • @JoshPeterson Nice. Didn't know that. I will now remove the custom xml file that solved the mail problem. Thanks. – Programmer Jun 09 '16 at 15:38
0

This is likely an issue with managed code stripping. I've posted a possible work around on the Unity forums here:

http://forum.unity3d.com/threads/unity-ios-and-ipv6-support.404938/#post-2670944

Josh Peterson
  • 2,299
  • 19
  • 21