Search Unity

Unity iOS 64 bit support

Discussion in 'iOS and tvOS' started by Mantas-Puida, Dec 23, 2014.

  1. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Update: iOS 64 bit support shipped as 4.6.2 (http://blogs.unity3d.com/2015/01/29/unity-4-6-2-ios-64-bit-support/)

    Hi Everyone,

    I'm making this post to serve as a checklist for preparing your projects for iOS 64 bit support. But before that I would like to share current status on Unity iOS 64 bit support, which I already posted on other forum threads few days ago..

    We already shipped first Unity 5 and Unity 4.6 alpha builds with iOS 64 bit support to the alpha group. We also partnered with Prime31 developers to make sure their plugins are 64 bit and IL2CPP compatible with first alpha builds. We are also working with dedicated focus group of developers to test it on as many different projects as possible. We expect to reach beta groups right after New Year.

    To better prepare for iOS 64 bit support:
    • start upgrading your current project to Unity 4.6 (or Unity 5) now, only these two versions of Unity will receive iOS 64 bit support.
    If you are dependent on some 3rd party plugins:
    • start asking plugin vendors for 64 bit versions of their plugin updates early;
    • if plugin vendors have troubles making them compatible with Unity iOS 64 bit scripting backend, they should contact support@unity3d.com or ping me directly via forum PM;
    if you are plugin vendor or making native plugins on your own, here is basic checklist:
    • like I mentioned above, iOS 64 bit support will be brought only to Unity 4.6 and 5.0 versions, so it's very important that plugins work fine with these versions;
    • Unity iOS 64 bit support is based on our own new .NET runtime implementation - IL2CPP, which means if plugin is using Mono runtime APIs (all the mono_* functions) then it won't link anymore. The best way to resolve this issue is switching to passing managed delegates to the native side of plugin and calling them as callbacks when some native data or event arrives;
    • all plugins that come as precompiled static libraries (.a files) should now include ARM64 slice;
    • plugins that are targeting Unity 5.0 should keep in mind that Unity 5.0 Xcode project has ARC enabled by default, so plugin code available as ObjC files should be ARC compatible, or plugin integration script should ensure that these files have additional compile option -fno-objc-arc set when added to Xcode project. Also precompiled plugins that are using standard C++ libraries should be compiled with libc++ (LLVM C++ standard library with C++11 support) option in Xcode.
    Our official blogpost on iOS 64 bit support can be found here: http://blogs.unity3d.com/2014/11/20/apple-ios-64-bit-support-in-unity/
     
    Last edited: Jan 29, 2015
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    We posted Unity 5.0 b19 in the Unity 5 Pre-Order Beta forum today for 5.0 pre-order customers. This build added iOS il2cpp and 64-bit support.

    As promised, we are also working on bringing iOS 64-bit support with il2cpp back to Unity 4.6. You can download and discuss a beta of Unity 4.6 with iOS 64-bit support in the iOS subforum, in this thread.
     
  3. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
  4. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
  5. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Fogbugz says, it's fixed and should go into next patch release 4.6.2p1
     
  6. seattlebluesky

    seattlebluesky

    Joined:
    Sep 2, 2014
    Posts:
    170
    Great. I was unsure as FogBugz 665476 remains open.
     
  7. OferSchlussel

    OferSchlussel

    Joined:
    Jan 2, 2014
    Posts:
    1
    Is it just me or the "Help->Report a Bug" has a bug ? ;-)

    I have a bug (another one) but can't report it

    BTW, I'm on Unity 4.6.2f1 on a mac (10.9.5)
     
  8. jeffsherwin

    jeffsherwin

    Joined:
    Aug 22, 2014
    Posts:
    47
    Having trouble using Parse with 4.6.2
    The ParseUser.CurrentUser is null

    Has been fine for months on MONO
     
  9. harish-g9

    harish-g9

    Joined:
    Jan 29, 2013
    Posts:
    7
    I updated Unity from 4.5.5 to 4.6 in MAC OSX 10.10.1 and using XCode 6.1.1. When I tried to make build, Xcode stopped working. Xcode window shows up once (for couple of seconds) and then shows up error "launching iOS project via Xcode 4 failed" in my console. It happened when I upgraded Unity to 4.6.

    Is this problem fixed in any of the patches?
     
  10. sbergen

    sbergen

    Joined:
    Jan 12, 2015
    Posts:
    53
    We are having issues with OnAudioFilterRead: If you simply add a script with the method implemented, sounds stop working on 64 bit builds. Works fine in the editor and with the Mono backend, but simply kills all audio output with IL2CPP. I tested this with a very minimalistic fresh project, and reported the bug from the Editor.
     
  11. eric_budge

    eric_budge

    Joined:
    Jul 3, 2013
    Posts:
    5
    Hi!

    With the IL2CPP compiler enabled calls to RSAVerifier.VerifyData() result in an infinite loop in our code. Is this a known issue:

    Example:
    RSAVerifier.VerifyData(VerifyFileData, HASH_ALGORITHM, SignatureData);

    Of course this was working perfectly fine pre-64-bit.

    Thanks for any information!
     
  12. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Please submit a bugreport!
    Thanks
     
  13. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    No, this is not known issue. Please bugreport it.
    Thanks!
     
  14. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    Reported
    Code (csharp):
    1. OnAudioFilterRead
    related bug, too

    If it is implemented (with empty body) the audio on GO doesn't play on the device with IL2CPP backend; does play with Mono backend

    Case 669069
     
  15. hao3039032

    hao3039032

    Joined:
    Oct 17, 2013
    Posts:
    3
    Hi! I have issues with Socket: the AsyncCallback delegate of Socket.BeginConnect had not been invoked, but it work well in Mono (2.x) . Is it a known issue?
     
  16. sbergen

    sbergen

    Joined:
    Jan 12, 2015
    Posts:
    53
    Case 669061.
    I noticed I forgot to press save before attaching the project, sorry. But the bug is really simple to reproduce. Just add an AudioSource and add the Filter script (which implements OnAudioFilterRead) to it.
     
  17. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    (Case 669261)
    I just submitted a IL2CPP related bug that again only hits old devices/iOS versions ( iPod 3rd Gen, iOS 5.1.1 ), iPad3/iOS 8.1 is fine ( no other version available to verify. ) . The Bug also did NOT occure with the scripting backend set to Mono and/or using Unity 4.6.1P4 and earlier
    Essentially it's a bug where the game crashes with the following message

    dyld: Symbol not found: ___sincosf_stret
    Referenced from: /var/mobile/Applications/....
    Expected in: /usr/lib/libSystem.B.dylib


    Crash happens midgame, as soon as the game coreloop starts ( where i DO some math and physics). At the time of crash, a whole load of scene and resource loading and setup already happened - it's really the start of the game core loop when this happens, long after the scene has been loaded and the level been setup.
    Debug session tells me this happens in PhysicManager->FixedUpdate().
    Googling told me that this is a somehow known crash caused by compiler optimizations regarding sinf()/cosf(), which are available on iOS7 and higher. This would fit to my experience getting the crash only on my iPod/iOS5.1.1

    I submitted the XCode project, sorry can't submit the whole Unity project because of legal issues
    See the case number on top of this message

    Despite this bug, congrats to the whole work on IL2CPP, i never thought i could get this rather big project to compile on IL2CPP so quickly ...
     
    Last edited: Feb 3, 2015
  18. Antti

    Antti

    Joined:
    Sep 24, 2012
    Posts:
    8
    When using the IL2CPP scripting backend, I get the following linker error from undefined symbols:

    Undefined symbols for architecture armv7:
    "Register_UnityEngine_Component_get_networkView()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_Internal_GetTime()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_get_peerType()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_NetworkView_Internal_RPC()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    ld: symbol(s) not found for architecture armv7


    This happens for both ARMv7 and ARM64 architectures. Mono 2.0 works fine.

    I thought it might be because of code stripping, so I added a link.xml file just to test if it makes a difference:

    <linker>
    <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.Network" preserve="all"/>
    </assembly>
    </linker>


    Adding the link.xml, I get more errors (from the Network class):

    Undefined symbols for architecture armv7:
    "Register_UnityEngine_Network_HavePublicAddress()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_get_isMessageQueueRunning()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_GetAveragePing()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_Internal_GetPlayer()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_get_connectionTesterPort()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_get_useNat()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    "Register_UnityEngine_Network_get_maxConnections()", referenced from:
    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
    ...


    Is this a bug that I should report, or am I doing something wrong? Any tips on how to proceed are appreciated.
     
  19. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    @Antti:
    I think the networking stuff is currently not supported with the IL2CPP backend ....
    Or am i wrong ?
     
  20. Antti

    Antti

    Joined:
    Sep 24, 2012
    Posts:
    8
    No, you're right! Thanks for pointing that out :)
     
  21. eric_budge

    eric_budge

    Joined:
    Jul 3, 2013
    Posts:
    5
    Reported, Thanks!
     
  22. Aistina

    Aistina

    Joined:
    Nov 20, 2012
    Posts:
    3
    We're also having trouble using the (now opensource) Ludosity's Steamworks Wrapper. The build from Unity works, but Xcode fails with errors like these:

    In file included from /Users/maarten/Documents/Unity/Midcore copy/iOS/March of War Face Off.Testing/Classes/Native/SteamworksManaged_ManagedSteam_Implementations_SteamService__15.h:6:

    /Users/maarten/Documents/Unity/Midcore copy/iOS/March of War Face Off.Testing/Classes/Native/SteamworksManaged_ManagedSteam_CallbackStructures_CloudEnume_0.h:32:26: error: field has incomplete type 'PublishedFileId_t18263'

    PublishedFileId_t18263 ___publishedFileId[50];

    Our link.xml is set up to preserve everything in the ManagedSteam namespace:

    <assembly fullname="SteamworksManaged">
    <namespace fullname="ManagedSteam" preserve="all" />
    </assembly>

    Is this a known bug? I wanted to report a bug from the editor, but clicking Report A Bug does nothing (4.6.2f1 on OSX 10.10.2).
     
  23. mhalttu

    mhalttu

    Joined:
    Mar 13, 2013
    Posts:
    30
    When I try to build our project with IL2CPP, the build freezes at the end. Unity is not responding and consumes 100% of CPU.

    The progress bar stays at 100% and says "prime[31] post processor Complete". The last thing in the logs is "prime[31] post processor completed Xcode integration for plugins: ../Unity-iPhone.xcodeproj/project.pbxproj: Property List error: Unexpected character / at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set."

    What could cause this? How can I provide you with additional information to help you solve the issue?
     
  24. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    I could be completely off base here, but it seems that doing the new 64bit export results in more crashes. Unity crashes on exporting about 40% of the time...not quite every other time.

    And my game, during scene switching, from a RAM intensive scene to a middle-man "loading" scene, crashes a LOT more.

    I'll be trying to A/B test once I know it's not something I've done, between the two build methods, however.

    MY QUICK TESTING RESULTS: My game uses a bunch of RAM, and I was having a forced-quit issue on iOS, with Xcode reporting 186mb used in the 64 bit version right before the quit. The Mono version used 176mb at the same point, and does not quit.
     
    Last edited: Feb 8, 2015
  25. serpin

    serpin

    Joined:
    Nov 13, 2011
    Posts:
    54
    I am also experiencing mid-level crashes for the IL2CPP build. For some reason it always happens at the same place of a level and I have absolutely no idea why. I don’t use reflection, no native DLLs or whatever. It just crashes BUT only on my iPad mini 3 which runs 64-bit version of the app. I’ve verified it by building a 64-bit app just to make sure. 32-bit IL2CPP app runs fine on the iPod touch 5G.
    Mono build doesn’t crash btw, but it’s 32-bit of course.

    Also after 4.6.2 I noticed that for some reason game runs on my iPhone 5 in aspect ratio of an iPad! I mean there are black bars on both sides! Why? It was running perfectly full-screen before the 4.6.2 update. This happens on both Mono and IL2CPP builds. This is a show stopper for me, since I can’t even update games in the AppStore any more, they are running 4:3 when they should be 16:9 on widescreen iOS devices.

    Unity team, please fix this!
     
  26. foolish-frost

    foolish-frost

    Joined:
    Mar 18, 2009
    Posts:
    169
    All right, I have tried every method google would share, and nothing works…

    How do I detect the encoding at runtime. I have tried just about everything in C#, including #if __LP64__ and #if CGFLOAT_IS_DOUBLE, along with several other options, and nothing can detect if the current codebase is running at 64 or 32 bit.

    Can we get a command or variable that will tell us what is currently running? It’s a simple feature, but very important for confirmation and testing.
     
  27. Yousician_unity_assets

    Yousician_unity_assets

    Joined:
    Dec 9, 2011
    Posts:
    11
    Any news about the OnAudioFilterRead issue, Case 669061? Out iOS release has been pending for quite some time now.
     
  28. Martin-S

    Martin-S

    Joined:
    Nov 19, 2012
    Posts:
    11
    @foolish frost
    Use System.IntPtr.Size to determine at runtime whether you're running 32- or 64-bit.
     
  29. qiang-zhou

    qiang-zhou

    Joined:
    Nov 17, 2014
    Posts:
    1
    i got a IL2CPP bug, but not know whether it is fixed, when we use zip to decompress my config file.

    the compiler interpret this statement:

    ~/Zip/Compression/Streams/StreamManipulator.cs

    buffer_ |= (uint)((window_[windowStart_++] & 0xff |
    (window_[windowStart_++] & 0xff) << 8) << bitsInBuffer_);
    // the index of window_[windowStart_++] are sam value, in twice times.

    // and i use those code fixed this issue, in temporary.
    byte [] aBuf = new byte[2];
    aBuf[0] = window_[windowStart_++];
    aBuf[1] = window_[windowStart_++];

    buffer_ |= (uint)(( (aBuf[0] & 0xff) | ((aBuf[1] & 0xff) << 8) ) << bitsInBuffer_);

    http://blog.csdn.net/zqtechnology/article/details/43667733
     
  30. Satoshi Ueda

    Satoshi Ueda

    Joined:
    Feb 10, 2015
    Posts:
    14
    1. I'm using Unity 4.61P5 and when I run an app on iOS6 or lower, the 3D Physics doesn't run properly and the app crashes. The crash happens when I run a project with objects that have Rigidbodies and Colliders attached.


    This is the error I get:


    dyld: lazy symbol binding failed: Symbol not found: ___sincosf_stret

    Referenced from: /var/mobile/Applications/7F199A75-88B8-4E16-ADF4-EA5201FDE66A/[bundleID].app/[bundleID]

    Expected in: /usr/lib/libSystem.B.dylib


    dyld: Symbol not found: ___sincosf_stret

    Referenced from: /var/mobile/Applications/7F199A75-88B8-4E16-ADF4-EA5201FDE66A/[bundleID].app/[bundleID]

    Expected in: /usr/lib/libSystem.B.dylib


    It looks like issue 669398 (http://issuetracker.unity3d.com/iss...und-sincosf-stret-is-thrown-since-4-dot-6-1p5).


    Is there are a workaround for this issue or a schedule for when the patch will be released?


    I was planning to release my game soon but this is causing me a lot of problems.


    I found this page too (http://stackoverflow.com/questions/19134132/sincosf-stret-crash-on-ios-5-1) and tried to set the deployment target correctly but that didn't solve the problem.


    I also have another problem:


    2. When I use Unity 4.6.2 to make a Universal build that works on both 32-bit and 64-bit iOS devices, the app size is about 2-4 times larger than a 32-bit build in Unity 4.6.0.

    Is there any way to keep the Universal app size the same as the 32-bit version, or reduce the size of Universal apps?


    These are the build settings I used:


    Scripting Backend : IL2CPP

    Architecture : Universal


    This is the size of each app:


    APP Unity4.6.0 IL2CPP+Arm64 IL2CPP+Universal

    A 66.8MB 89.6MB 112.6MB

    B 72.2MB 97.3MB 122.4MB

    C 41.0MB 59.4MB 79.8MB

    D 29.0MB 48.3MB 69.4MB

    E 26.5MB 61.9MB 82.3MB
     
  31. NickSergeev

    NickSergeev

    Joined:
    Dec 19, 2012
    Posts:
    15
    We're recently updated to Unity 4.6.2 and trying to build our game with IL2CPP scripting backend and architecture universal and we're experiencing exactly the same issue that Satoshi described above - build size has grown enormously, what's even worst - unix executable size is now more than 60Mb - and this is not acceptable, as Apple has limitation for this (see p. 78) although this binary successfully passes Xcode validation. We were hoping on latest 4.6.2 patch release - but build size is now even bigger. The situation is critical because we passed deadline for 2 weeks, not sure what should we do now..
     
  32. JeremyGalxyz

    JeremyGalxyz

    Joined:
    Nov 15, 2014
    Posts:
    4
    Anyone else having problems with RSACryptoServiceProvider and IL2CPP? Doesn't seem to work anymore...
     
  33. Satoshi Ueda

    Satoshi Ueda

    Joined:
    Feb 10, 2015
    Posts:
    14
    We talked to Unity Japan. It seems like it's already fixed. Maybe we have to wait for the next patch to be released sometime around next week?
     
  34. spacefrog

    spacefrog

    Joined:
    Jun 14, 2009
    Posts:
    734
    I've "heard" that the fix should come with the next patch ( 4.6.2P2 )
     
    jounisuom likes this.
  35. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Yes, Unity 4.6.2p2 is out today and it should fix iOS 5.1/iOS6.0 issues.
     
  36. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    2x increase is expected because Universal app just duplicates application binary and it's generic feature of the platform. Though currently with IL2CPP it's between 2x and 4x and we are working hard to get it down to 2x, we hope to get some enhancements in couple of next weeks. Generics are currently biggest contributors to the application size.
     
    Satoshi Ueda likes this.
  37. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    It was fixed with today's patch release (4.6.2p2).
     
  38. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    We would love to look into your projects. Do you have bugreport numbers for your issues?
     
  39. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Please bugreport it and attach your project for investigation.
    Thanks!
     
  40. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    This might be fixed on latest patch release. Please also make sure you are using latest version of Prime31 plugin.
     
  41. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Please submit a bugreport.
    Thanks!
     
  42. NickSergeev

    NickSergeev

    Joined:
    Dec 19, 2012
    Posts:
    15
    Hi Mantas, thanks for your reply, can you provide any specific recommendations on how we can affect unix executable file size at the moment? With mono scripting backend it was around 30mb, now its 80mb
     
  43. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Do you have lots of own generic types?
     
  44. Satoshi Ueda

    Satoshi Ueda

    Joined:
    Feb 10, 2015
    Posts:
    14
    Thanks, can you fix it in the next patch?
     
  45. NickSergeev

    NickSergeev

    Joined:
    Dec 19, 2012
    Posts:
    15
    I can't say that there are too many of them, we gonna get rid of them today and see how this will affect binary size.
    By the way latest patch release makes binary size even bigger so we switched back to 4.6.2..
     
  46. TinyMobGraham

    TinyMobGraham

    Joined:
    Oct 17, 2013
    Posts:
    38
    I have this exact same problem. I have all my prime31 stuff updated to the most recent, supposedly 64bit ready versions. How can we resolve this?
     
  47. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
  48. LividTheDream

    LividTheDream

    Joined:
    Sep 29, 2012
    Posts:
    17
    I tried 4.6.2p2 and it appears to have fixed a lot of the networking linker errors I had. However, when my app runs I'm getting the following error whether I run with IL2CPP or not (I didn't get this error with 4.6.2p1 when running without IL2CPP):

    applicationDidFinishLaunching()
    You are using Unity iPhone Basic. You are not allowed to remove the Unity splash screen from your game
     
  49. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    To fix the problem, please try following actions:
    1. remove app from device manually
    2. replace Xcode project from scratch instead of appending it
     
  50. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    delete UILaunchStoryboardName~iphone in Xcode target Info settings
    see http://forum.unity3d.com/threads/4-6-2p2-free-version-ios-crash.297722/
    with this it at least runs with Unity 4.6.2p2 free