Search Unity

Unity iOS 64 bit support

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

  1. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    The below worked for me, thanks r618 for the link. :)
    xcode 6.1.1
    iphone 6
    latest firmware
    latest unity 4.6.2.2

     
  2. mhalttu

    mhalttu

    Joined:
    Mar 13, 2013
    Posts:
    30
    @Mantas Puida

    I tried the build on Unity 4.6.3f1 and I get the same problem.

    Code (csharp):
    1.  
    2. prime[31] post processor completed Xcode integration for plugins: /Users/mhalttu/Desktop/TestBuild/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.
    3. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    4. UnityEngine.Debug:Log(Object)
    5. Prime31Editor.MenuItem:runLegacyPostProcessor(BuildTarget, String)
    6. Prime31Editor.MenuItem:onPostProcessBuildPlayer(BuildTarget, String)
    7. UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, BuildTarget, BuildOptions, Boolean, UInt32&)
    8. UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions, Boolean)
    9. UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions)
    10. UnityEditor.BuildPlayerWindow:GUIBuildButtons(Boolean, Boolean, Boolean, BuildPlatform)
    11. UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings()
    12. UnityEditor.BuildPlayerWindow:OnGUI()
    13. System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
    14. System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    15. System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    16. UnityEditor.HostView:Invoke(String, Object)
    17. UnityEditor.HostView:Invoke(String)
    18. UnityEditor.HostView:OnGUI()
    19.  
    20. (Filename: /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)
    21.  
     
  3. TristAAn

    TristAAn

    Joined:
    Jul 10, 2012
    Posts:
    8
    Please, if anyone could just tell can I release to Apple post 64-bit requirement; using Unity3d 4.6.3??

    After reading all the posts, all I am hearing is: 'We are so happy to release IL2CPP update and IOS64bit supported' & 'you can build 64bit IOS apps now in 4.6' & 'IOS is supported in 4.6'... But in reality: The Xcode builds will fail with all manor of errors (see below).

    When you say it is supported, doesn't mean it will work...


    I just heard that BinaryFormatter is broke in 4.6.3...MD5 Hashing isn't working on 4.6.3..

    Now, I've just installed 4.6.3, updated all my 3rd-Party plugins(Prime31 & IOS Native)

    Successfully build ARMv7 in Xcode - Failed building ARM64

    What can I do?

    Same 88 errors when building in Xcode for 64bit:


    "_UnityADInterstitialADWasLoaded", referenced from:

    "_UnityADBannerViewWasLoaded", referenced from:

    "_UnityDropViewTouchProcessing", referenced from:

    "SetLogEntryHandler(bool (*)(LogType, char const*, char*))", referenced from:

    "_UnityCleanup", referenced from:

    "UnityStopVideoIfPlaying()", referenced from:

    "_UnityForcedPlayerLoop", referenced from:

    "_UnitySendRemoteNotificationError", referenced from:

    "_UnitySendDeviceToken", referenced from:

    "_UnityInitApplicationGraphics", referenced from:

    "_UnityLoadApplication", referenced from:

    "_UnitySendTouchesMoved", referenced from:

    "_UnitySendTouchesCancelled", referenced from:

    "_UnitySendTouchesEnded", referenced from:

    "_UnityGetDesiredMSAASampleCount", referenced from:

    "_UnityInitApplicationNoGraphics", referenced from:

    "_UnitySendLocalNotification", referenced from:

    "_UnitySendTouchesBegin", referenced from:

    "_UnityFinishRendering", referenced from:

    "_UnityUse32bitDisplayBuffer", referenced from:

    "_UnityReportResizeView", referenced from:

    "_UnityIsCaptureScreenshotRequested", referenced from:

    "_UnityCaptureScreenshot", referenced from:

    "_UnityBlitToSystemFB", referenced from:

    "_UnityDestroyExternalDepthSurface", referenced from:

    "_UnityRegisterFBO", referenced from:

    "_UnityHasRenderingAPIExtension", referenced from:

    "_UnityReportBackbufferChange", referenced from:

    "_mono_aot_module_Assembly_CSharp_firstpass_info", referenced from:

    "_UnityReportWWWSentData", referenced from:

    "_UnitySetViewTouchProcessing", referenced from:

    "_UnityRequestedScreenOrientation", referenced from:

    "_UnityIsOrientationEnabled", referenced from:

    "_mono_aot_module_PlayMaker_info", referenced from:

    "UnitySetLastLocation(double, float, float, float, float, float)", referenced from:

    "_UnityADBannerViewWasClicked", referenced from:

    "_UnityReportWWWFailedWithError", referenced from:

    "_UnityReportWWWReceivedData", referenced from:

    "_mono_aot_module_System_Configuration_info", referenced from:

    "_UnityReportWWWStatusError", referenced from:

    "__getLeadrBoardScore", referenced from:

    "_mono_aot_module_System_Core_info", referenced from:

    "_UnityReportWWWReceivedResponse", referenced from:

    "_mono_ficall_flag", referenced from:

    "_mono_dl_register_symbol", referenced from:

    "_mono_aot_only", referenced from:

    "_UnityUseAnimatedAutorotation", referenced from:

    "_UnityPlayerLoop", referenced from:

    "_mono_aot_module_Assembly_Boo_info", referenced from:

    "_mono_aot_register_module", referenced from:

    "_mono_aot_module_Assembly_UnityScript_firstpass_info", referenced from:

    "_UnityDestroyExternalColorSurface", referenced from:

    "_mono_aot_module_Assembly_UnityScript_info", referenced from:

    "_UnityCreateUpdateExternalColorSurface", referenced from:

    "_mono_aot_module_Boo_Lang_info", referenced from:

    "_UnityIsRenderingAPISupported", referenced from:

    "_UnityPause", referenced from:

    "UnitySetLastHeading(float, float, float, float, float, double)", referenced from:

    "_mono_aot_module_Mono_Posix_info", referenced from:

    "_mono_aot_module_System_Xml_info", referenced from:

    "_UnityInputProcess", referenced from:

    "_mono_aot_module_Mono_Security_info", referenced from:

    "_UnitySetPlayerFocus", referenced from:

    "_mono_aot_module_Assembly_CSharp_info", referenced from:

    "_mono_aot_module_System_info", referenced from:

    "_UnitySetDefaultFBO", referenced from:

    "_UnityReportWWWFinishedLoadingData", referenced from:

    "__loadLeadrBoardScore", referenced from:

    "_mono_aot_module_UnityEngine_UI_info", referenced from:

    "_UnityUpdateDisplayList", referenced from:

    "_mono_aot_module_UnityEngine_info", referenced from:

    "_mono_aot_module_UnityScript_Lang_info", referenced from:

    "__showLeaderBoard", referenced from:

    "_UnitySendMessage", referenced from:

    "_mono_aot_module_mscorlib_info", referenced from:

    "_UnityUse24bitDepthBuffer", referenced from:

    "_UnityDisableRenderBuffers", referenced from:

    "_mono_aot_module_System_Security_info", referenced from:

    "_UnityParseCommandLine", referenced from:

    "_UnitySendRemoteNotification", referenced from:

    "__initGamaCenter", referenced from:

    "__showLeaderBoards", referenced from:

    "_UnityCreateUpdateExternalDepthSurface", referenced from:

    "_mono_aot_module_P31RestKit_info", referenced from:

    "_UnityGetRenderingResolution", referenced from:

    "_UnityGetSystemResolution", referenced from:

    "_UnityGetTargetFPS", referenced from:

    clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
    samrad likes this.
  4. AyreGuitar

    AyreGuitar

    Joined:
    Oct 12, 2013
    Posts:
    35
    TristAAn - I feel your pain.

    FWIW I did manage to make a valid universal build using Unity 4.6.3 and Xcode 6.1 - but I had to tweak my min iOS from 5.1 to 5.1.1 by reselecting:

    Build Settings > Architectures to Standard Architectures (armv7, arm64)

    which brings a pop-up in XCode asking if OK to change min iOS to 5.1.1

    Would be nice if this was possible to do in Unity directly but nearest option is 5.1 (probably due to Apple, since that's as close as I can set it in the General > Deplyment Info > Deployment Target section in XCode.

    The resulting Archive validates with iTunes Connect (so isn't complaining about missing 64bit support for a new app). But I can confirm that BinaryFormatter is broken (hopefully fixed in 4.6.3p1)
     
  5. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Did you build it with IL2CPP scripting backend or Mono?
     
  6. Satoshi Ueda

    Satoshi Ueda

    Joined:
    Feb 10, 2015
    Posts:
    14
    Hi Mantas, I posted the same question here as well (http://forum.unity3d.com/threads/4-6-ios-64-bit-beta.290551/page-19) but the size of our app was 99.5 MB with Unity 4.3.1 (IL2CPP Universal Release), now it's 103 MB with the latest patch!

    Did other people experience the same issue? Should we wait until the next patch to see if the same issue occurs, or should we work on reducing the size of the textures and sound? We'd love to hear your opinions!
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @Satoshi Ueda

    Unfortunately, don't expect any size reduction in the upcoming 4.6.3p2. We have so work to provide size reduction in progress, but it is not ready yet. I can't say when it will land.
     
  8. Satoshi Ueda

    Satoshi Ueda

    Joined:
    Feb 10, 2015
    Posts:
    14
    Hi Josh, Thanks for the info. Hope you can do something before June.
     
  9. toasterStreudal

    toasterStreudal

    Joined:
    Dec 14, 2012
    Posts:
    10
    Does IL2CPP work with imported DLLs? I am loading asset bundles which reference classes in an included DLL. If I use mono it works as expected on device. However, if I use IL2CPP I get the following:

    The referenced script on this Behaviour is missing!


    (Filename: Line: 1608)


    A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 40 bytes)

    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
     
  10. sanketdesai82

    sanketdesai82

    Joined:
    Mar 4, 2015
    Posts:
    1
    I am unable to provide you with a log from Xcode regarding this as my current development environment does not support it (I just have a distribution profile and not development to debug from xcode).

    However I hope you will take a look at this situation :

    I am not receiving any calls backs for Requesting product list. Neither productListRequestFailedEvent nor productListReceivedEvent is being fired. Because of which we are unable to proceed with any IAP Actions.

    • We have updated to the latest version available from Asset Store (v 2.1 )
    • If we turn the build from IL2CPP/Universal to Mono, everything works just fine.
    • This only happens when we build with IL2CPP/Universal.
    I will update this thread with any logs if I can obtain it. But I was wondering if you perhaps know of this or any similar issues and might have a solution. This issue is blocking our shipping, any help is much appreciated.

    Thank you.
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @sanketdesai82

    We do have some outstanding bugs related to sockets and similar code. I can't determine that your problem matches one of those though. Any additional information you can provide will be helpful to us. Thanks.
     
  12. badescuga9

    badescuga9

    Joined:
    Dec 11, 2012
    Posts:
    37
    Hi! Did you manage to overcome this problem? i am also getting this..
     
  13. badescuga9

    badescuga9

    Joined:
    Dec 11, 2012
    Posts:
    37
    Hi! Did you manage to overcome this problem? i am also getting this..
    Hey! Did you overcome this problem? I get this same behaviour
     
  14. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
    @JoshPeterson I am having all sorts of troubles with socket based applications, even very simple ones when exported to iOS 64 bit. (using IL2CPP)

    Are sockets supported at all for this platform, as of today? (March 16th)

    Thanks
     
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @g_a_p

    Yes, sockets are supported as of today. We have been working through some bugs related to sockets though, So any information you can provide about the projects that are having problems will be appreciated. If you've tried the latest patch release (4.6.3p3), please submit a bug with a project that reproduces the problem. Thanks!
     
  16. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
    Thanks for the fast reply.
    I have tested with Unity 5, latest available release. Does this change anything?
     
  17. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @g_a_p

    No, we have one version of IL2CPP internally that we port to all released versions of Unity. At this time, the Unity 5 release is a bit behind 4.6.3p3, actually. 5.0.0p1 will bring us even with 4.6.3p2, and 5.0.0p2 will bring us even with 4.6.3p3.

    See this post for some more details: http://forum.unity3d.com/threads/ios-64-bit-patch-release-plans-for-4-6-and-5-0.310371/
     
    g_a_p likes this.
  18. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    281
  19. avatarmagus

    avatarmagus

    Joined:
    Mar 17, 2015
    Posts:
    2
    I have encountered following error,

    System.MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.NullableConverter'.

    .. and it blocks me for 2 days!

    please help!
     
  20. salvacodi

    salvacodi

    Joined:
    Feb 24, 2015
    Posts:
    1
    I don't see this il2cpp error in other forum posts, so i put it here to find help:
    With Unity 4.6.3.p3 and 5.0.0p1 i get the following error in xcode compile phase:
    /Users/codigamesmac1/Documents/Builds/dun/dun-u5/Classes/Native/Bulk_ICSharpCode.SharpZipLib_0.cpp:6083:3: Use of undeclared identifier 'Stream_Finalize_m21689'

    The lines on resides error on cpp file are:
    Code (CSharp):
    1.  
    2. IL_0009:
    3.     { // begin finally (depth: 1)
    4.         Stream_Finalize_m21689(__this, /*hidden argument*/&Stream_Finalize_m21689_MethodInfo);
    5.         // finally node depth: 1
    6.         switch (leaveInstructions[0])
    7.         {
    8.             case 0x10:
    9.                 goto IL_0010;
    10.             default:
    11.             {
    12.                 #if IL2CPP_DEBUG
    13.                 assert( __last_unhandled_exception != 0 && "invalid leaveInstruction at depth 1, __last_unhandled_exception has not been set");
    14.                 #endif
    15.                 Exception_t266 * _tmp_exception_local = __last_unhandled_exception;
    16.                 __last_unhandled_exception = 0;
    17.                 il2cpp_codegen_raise_exception (_tmp_exception_local);
    18.             }
    19.         }
    20.     } // end finanlly (depth: 1)
    I don't know if SharpZipLib is mandatory, trying to remove from project causes many other errors.

    Obviously, on mono the project compile and runs correctly.
     
  21. DarkCooker

    DarkCooker

    Joined:
    Jan 7, 2015
    Posts:
    119
    Hi unity engineer
    We have issue with Sharpziplib library
    It does not work on unzip
    It is important to let the mobile download a batch of files quickly.

    All unzip works well in android and ios 32bits

    I have an app project (never subirted to review before) created last year in iTunes, not sure if we can upload 32bit to work around this for urgent

    Thanks
     
  22. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @avatarmagus

    It is difficult to tell what the cause of the problem is with this error message alone. Could you provide more details? Specifically, when is this error message occurring? Does the same message occur when you build with the Mono scripting backend? Is it possible for you to submit a bug report and include the project that causes this issue? Thanks.
     
  23. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @salvacodi

    I have seen this in at least one other case, it I remember correctly. I believe the error occurs because there really is no Finalize method on the Stream class, at least in the version of mscorlib.dll from Mono used with Unity. I think this can happen when SharpZipLib is built against a different .NET profile, then used in the Unity project. So I think that you might have a few options:

    - Try to remove SharpZipLib if you don't need it. It is not required by Unity, but might be required for your project.
    - If you have the source code for SharpZipLib, try to add it to the Unity project, and let Unity compile it with its version of the Mono compiler.

    In either case, if is possible for you to submit a bug with this project, as it is now? Since this works with the Mono scripting backend, it should work with IL2CPP, so we would like to correct it. Thanks.
     
  24. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @M40 Dev

    Could you submit a bug and include the project that causes this problem? That will give us the best chance to correct it.

    Unfortunately, I can't provide any guidance about Apple's submission guidelines, you'll need to talk with them.
     
  25. nupur1

    nupur1

    Joined:
    Apr 9, 2015
    Posts:
    5
    iOS apps uploaded to the App Store must include 64-bit support and be built with the iOS 8 SDK, included in Xcode 6 or later. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.
     
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @nupur1

    Sorry, I'm not sure that I understand your post here. Are you asking how to target 64-bit iOS with Unity?
     
  27. AIMPro_Banu

    AIMPro_Banu

    Joined:
    Apr 13, 2015
    Posts:
    2
    hi
    i get an error on Xcode console using Application.persistentDataPath

    NotSupportedException: /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection/Assembly.cpp(363) : Unsupported internal call for IL2CPP:Assembly::GetManifestResourceInfoInternal - "This icall is not supported by il2cpp."

    and a second using System.Reflection.Assembly

    case: 688065
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @AIMPro_Banu

    We're not yet supporting resources with IL2CPP. It is a priority item though that we would like to add support for soon.

    In general, System.Reflection.Assembly should work. In this case, it looks like the Location property is null or empty. I'm not sure why that is, but we can investigate. Thanks for the bug report.
     
  29. AIMPro_Banu

    AIMPro_Banu

    Joined:
    Apr 13, 2015
    Posts:
    2
    Thank you
     
  30. super77gg

    super77gg

    Joined:
    Sep 25, 2014
    Posts:
    46
    Hello -

    We've run into a bit of an issue converting our Mono project to IL2CPP. Unfortunately, we are having some trouble deciphering the errors. We've gone ahead and submitted a bug report (689788). We've tested bulding in 5.0.1 and 5.0.1p1.

    Here's what's in our console:

     
    Last edited: Apr 16, 2015
  31. tiagopasccoal

    tiagopasccoal

    Joined:
    Mar 26, 2013
    Posts:
    8
    Hello

    I think I have a similar problem.

    When I try to compile my app with IL2CPP for 64bits, I can compile but when I start the app I have the following error.

    /Users/builduser/buildslave/unity/build/Tools/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection/Assembly.cpp(363) : Unsupported internal call for IL2CPP:Assembly::GetManifestResourceInfoInternal - "This icall is not supported by il2cpp."

    I think it's related to Application.persistentDataPath, because it's when i try to download some content to this folder, but is also when i try to access some functions on a external dll.

    Any ideias about this? I never had this problem when I use Mono.

    Thanks
    Tiago Pascoal
     
  32. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @nate77

    It looks like the important part of the error message is this:

    > Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'UnityEditor, Culture=neutral, PublicKeyToken=null'

    It looks like the UnusedBytecodeStripper2.exe utility (which is part of the IL2CPP build process) is attempting to strip the UnityEditor.dll assembly. This should not be happening, as only code in the player should be stripped and converted. Is there some player code in this project which is pulling in a dependencies on editor code?
     
  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @tiagopasccoal

    We don't yet support manifest resources for IL2CPP, although we would like to add this support soon. If you are not using resources directly, maybe some part of the project is using them indirectly. Do you have the full stack trace for this exception? That might help track down the code which is using resources.
     
  34. devAl

    devAl

    Joined:
    Feb 27, 2013
    Posts:
    6
    I was trying out Unity 5.1.0 beta 3 today and my project compiles fine in Unity using il2cpp withe arm64 target but when I run it in xcode I get the following errors:

    .../Deploy/iOS64/Classes/Prefix.pch:12: Must use 'struct' tag to refer to type 'RenderSurfaceBase'
    and
    .../Deploy/iOS64/Classes/Prefix.pch:12: Must use 'enum' tag to refer to type 'UnityFramebufferTarget'

    Line 12 of prefix.pch has ...
    #include "UnityInterface.h"

    Here are the entries from UnityInterface.h...

    Lines 68-69:
    // final blit to backbuffer

    voidUnityBlitToBackbuffer(RenderSurfaceBase* srcColor, RenderSurfaceBase* dstColor, RenderSurfaceBase* dstDepth);
    Line 76-83:
    // This must match the one in ApiEnumsGLES.h

    enum UnityFramebufferTarget

    {

    kDrawFramebuffer = 0,

    kReadFramebuffer,

    kFramebufferTargetCount

    };

    voidUnityBindFramebuffer(UnityFramebufferTarget target, int fbo);



    My XCode knowledge is extremely limited but any ideas or pointers would be very helpful.
     
  35. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @devAl

    Can you try to build with the Mono scripting backend, to see if the same error occurs? Initially, it looks like this not specific to IL2CPP, but may be a more general iOS problem. If we can confirm that information, it will help us track down the cause of the problem.
     
  36. devAl

    devAl

    Joined:
    Feb 27, 2013
    Posts:
    6
    @JoshPeterson: I tried the build with Mono and sure enough I got the exact same errors.
     
  37. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    cd to your trampoline folder (the folder that contains Unity-iPhone.xcodeproj) put attached file here and run
    patch -p1 < trampoline_ccode.txt
    *sure it will be fixed before release
     

    Attached Files:

  38. devAl

    devAl

    Joined:
    Feb 27, 2013
    Posts:
    6
    @Alexey: That worked thanks.
     
  39. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    We have issues with VERY bad performance when parsing json and xml data on iOS with IL2CPP.
    This goes for parsing via JSONObject and for example XmlTextReader.

    With JSONObject, parsing about 40 small json files takes 4 seconds with Mono. With IL2CPP it takes 30(!) seconds.
    With XmlTextReader, parsing one 15mb xml file with lots of values takes 5 seconds with Mono. Takes 70(!) seconds with IL2CPP.

    Note that in both cases its deserialization from strings to classes that is slow, NOT reading the actual files.
    Is there something inherently slow with lots of string manipulations on IL2CPP?

    Everything else works the same or faster than with Mono.

    This is a real showstopper for us, we have 6 apps right now that are affected.
    For 5 of them, we use a temporary solution where json data is converted to binary pre-publish.
    For the 6th, we still have the option to publish with Mono since its released internally on the customer's own store.

    I dont have time to recreate the issues in a small project for bug reporting, but this MUST be something that you are already aware of?
    It would be very weird if noone else is having the same issues.
     
  40. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    If you have a repro / sample project I could run a comparison using my JSON .NET port as well and see if I see the same slowness and/or see if I can pin down what operations might cause it.
     
  41. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    Thats really kind of you! I cant promise that I have time to create a repro this week, but I will certainly try.
     
    Dustin-Horne likes this.
  42. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    642
    Hi,

    Has anyone found a way to access the 'Scripting Backend' setting in PlayerSettings from a script?

    I'd like to be able to force il2cpp builds from our build machine, while we stick to Mono for development builds (due to the differences in compile time)
     
  43. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    bluescrn likes this.
  44. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @Mistale @Dustin Horne

    We have found similar problems internally. It looks now like the performance issues are related to the implementation of try/finally blocks in IL2CPP. Specifically, we were suing C++ exceptions (which have poor performance in the exceptional case) to enter finally blocks. We have some changes landing internally today to stop using C++ exceptions for finally blocks, so we are expecting much better performance soon.

    We need to need to profile some test cases with these changes, but I would expect the next round of patch releases to include these changes. Note that our next release for 4.6 will be the 4.6.5 feature release. This release will not include any new code which is not already in 4.6.4p4. So we're probably a little further away from having these XML fixes available than we normally would be. They are coming though.
     
    Mistale and Dustin-Horne like this.
  45. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    @JoshPeterson - Once we have the symbol defines for IL2CPP it might be good to have one for Exceptions as well (depending on the player setting). If I know that the build is IL2CPP and that the user hasn't enabled exceptions then I can use directives to completely eliminate try/catch/finally as they won't be used anyway as I understand it (unless exception handling works differently in iOS than it does WebGL).
     
  46. Mistale

    Mistale

    Joined:
    Apr 18, 2012
    Posts:
    173
    @JoshPeterson That sounds great! I'll hold off with the repro for a while, you're probably on the right track. It would be strange if there was another major bottleneck that you haven't already seen.
     
  47. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @Dustin Horne

    This is a good point. We will consider adding something you can use to check for exception support at compile time in C# code. For iOS and WebGL, the exception implementations are the same. That is, il2cpp.exe generates the same code for both. However, often exception support is disabled for WebGL.
     
  48. F.Salka

    F.Salka

    Joined:
    Dec 13, 2013
    Posts:
    43
    Hello,

    We've noticed that some operations using the il2cpp back-end are now insanely slower.

    For Example, this function that we use inside the app is now x100 times slower compared to the mono backed:

    Code (CSharp):
    1. public void getNextNote()
    2.      {
    3.         NotesPos = Notes.OrderBy(Note => Note.transform.position.x).ToArray();
    4.         foreach (GameObject note in NotesPos) {
    5.             if (!note.GetComponent<NoteViz_Handler> ().isPedal && !note.GetComponent<NoteViz_Handler> ().isTempo
    6.                 && note.GetComponent<NoteViz_Handler>().trackActive && !note.GetComponent<NoteViz_Handler> ().isMusicBar) {
    7.                 if (note.transform.position.x > TimeMarker.transform.position.x) {
    8.                     TimeMarker.transform.position = new Vector3 (note.transform.position.x + skidValue, TimeMarker.transform.position.y, TimeMarker.transform.position.z);
    9.                     break;
    10.                 }
    11.             }
    12.         }
    13.     }
    Is it the OrderBy? Or the foreach() loop (there are 5500 notes gameObjects)? Isn't the il2cpp supposed to be faster at these operations? Any optimization tips we could use to make this work faster with il2cpp?

    - Thanks!
     
    Last edited: Apr 28, 2015
  49. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @F.Salka

    I don't see anything in this code which we know is slow, so I can't offer any tips for optimizing it. We would, however, like to profile this case to determine why it is slower and correct it. Can you submit a bug report with a project that reproduces this issue? Thanks.
     
  50. Sscia

    Sscia

    Joined:
    Jan 24, 2014
    Posts:
    1
    Hi,

    We managed to compile an xcode project using IL2CPP Universal.
    Trying to build on xcode to an iPhone 6+ is failing due to the following error: http://i.imgur.com/NvhU8xO.png


    We are using Unity 4.6.4p4 with xCode 6.1 on OSX 10.10.
    Here is the Unity player settings for the build: http://i.imgur.com/A1uQgOc.png


    We have no idea what is the cause for the build error, it seems like something in the IL2CPP mechanism.
    Would greatly appreciate any help on the matter.
    Thanks!