Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

4.6 iOS 64-bit beta

Discussion in 'iOS and tvOS' started by jonas-echterhoff, Jan 12, 2015.

  1. Martin-S

    Martin-S

    Joined:
    Nov 19, 2012
    Posts:
    11
    A simple co-routine does not work for me when using IL2CPP.

    void Start()
    {
    StartCoroutine(Play());
    }


    IEnumerator Play()
    {
    Debug.Log("Co-routine plays");
    yield break;
    }


    The generated cpp code skips the Debug.Log line. Filed as bug Case 663197.
     
  2. Wiliz

    Wiliz

    Joined:
    Feb 18, 2014
    Posts:
    20
    I've submitted this same bug (case 663004.) IL2CPP generates incorrect code for the coroutine when the only yield it contains is 'yield break'. If you add other kinds of yields into it, then it will work.
     
  3. commodore

    commodore

    Joined:
    May 30, 2012
    Posts:
    36
    Ok it shows up now. I had downloaded the 4.6.1p3 patch twice but it finally worked when I downloaded it from the link in this thread. Is there a chance that the patch on this page isn't the same as the one in the link in this thread?
     
  4. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,859
    Yes, this forum contains link to custom build with iOS 64 bit support. We aim to land to regular patch-release next week. Fingers crossed... :)
     
  5. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    I ran a 1st quick test of my game last night with IL2CPP. Got lots of warnings (most of them already mentioned in this thread), the estimated app size in the store went from 100 to 132MB as expected, and it seemed to run OK for the most part. Here are 3 things I noticed though:

    - in the console window of XCode, I saw some messages such as:
    Unable to find type UnityEngine.ResourceRequest
    Unable to find type UnityEngine.SocialPlatforms.GameCenter.GameCenterPlatform
    Not sure what this is about and probably harmless, this project definitely doesn't use the GameCenter stuff (I have a plugin for that)

    - I got the impression the game was lagging from time to time, like some frames were skipped, similar to what you would get with long garbage collections. I don't think I've ever seen those in the Mono version built with 4.6.1f1, but I'll have to play both versions more, and maybe profile them, to be 100% sure.

    - I got a 100% crash that should be easy to fix, trying to marshal a null string when calling a plugin. Case 663353
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    Thanks for the information @Frederic My.

    - We're actively looking at the issues with GameCenterPlatform, etc. It seems that something is being incorrectly stripped from UnityEngine.dll.

    - If you can scope done the lag to something that we can investigate, we would certainly like to sort it out.

    - We have an internal fix for case 663353. It may not make the next 4.6 iOS/IL2CPP release, but it will be coming out soon.
     
    Frederic-My likes this.
  7. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    168
    Hey,

    Thanks for the reports. I've reproduced and fixed the "coroutine with only a yield break" bugs (66319 &
    663004).
    The "GameCenter" doesn't work bug has been found, cause been found, and I'm working on a fix.

    I haven't checked lately, but the unity profiler should work with il2cpp builds, so there's a good chance you can use it to identify the spikes you're seeing, and see if they are gc related, or something else. You could also use apple's instruments. If it is gc, you'll see a lot of symbols on the stack that start with GC_mark (GC_mark_some especially).
    If you're having a hard time figuring out what is causing the spikes, and it is reproducable, we would love to get a bugreport on it.

    Thanks for all the bugreports, please keep 'm coming, we're knocking them all down as fast as we can.

    Lucas
     
    Frederic-My likes this.
  8. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    2 quick questions:

    - to test the 64 bit part of the build, I only need to run it on an iPhone 5S/6/6+, right? Nothing else I need to do? So far I've only tried my project on a 32 bit iPad.

    - I wanted to double check the versions of some libraries I use (for example: Flurry) support 64 bits. In a terminal window, when I do:
    file libFlurry_5.4.0.a
    I don't see arm64 listed. However, if 64 bits wasn't supported, I would get link errors when XCode compiles the Unity project, wouldn't I?
    Actually, there is one plugin I wrote myself and haven't recompiled yet, and I'm not getting link errors; how come?
     
  9. paupawsan

    paupawsan

    Joined:
    Feb 9, 2013
    Posts:
    3
    Last edited: Jan 15, 2015
  10. TristAAn

    TristAAn

    Joined:
    Jul 10, 2012
    Posts:
    8
    Ok after removing and reinstalling each (Updated) component one by one.. I have a working IL2CPP build. When I run the app on my test device I get the following error:

    Initialize engine version: 4.6.1p3 (f86f15b5d5ee)

    Unable to find type [UnityEngine.dll]UnityEngine.ResourceRequest

    ...and following can't find other important DLLs

    I can confirm Prime31's components are all working with the exception of Android Combo, the IOS interfaces have not yet been updated.
     
  11. kaka1412

    kaka1412

    Joined:
    Aug 20, 2012
    Posts:
    5
    Follow your steps , I rebuilt my project with this version. The application build successfully, but there is a problem when run. The debug stop at this function of il2cpp-codegen.h file and these lines:

    staticinlinevoid* SZArrayLdElema (Il2CppCodeGenArray* arr, uint32_t index)
    {

    TypeInfo* arrayKlass = arr->_typeInfo;

    return (void*)((((uint8_t*)(arr)) + sizeof (Il2CppCodeGenArray)) + (arrayKlass->element_size * (index)));

    }

    it's a EXC_BAD_ACCESS error with arrayKlass is NULL.

    Could you please explain to me what can make this problem happen?

    Many thanks,
     
  12. gadzilka

    gadzilka

    Joined:
    Apr 3, 2013
    Posts:
    1
    Hi,
    I have a problem when I try to use sqlite on iOS:

    NotSupportedException: Tools/il2cpp/il2cpp/libil2cpp/os/Posix/LibraryLoader.cpp(16) : Unsupported internal call for IL2CPP:LibraryLoader::LoadDynamicLibrary - "PInvoke is not yet supported on Posix platforms."
    at SQLite.SQLite3.Open (System.Byte[] filename, IntPtr& db, Int32 flags, IntPtr zvfs) [0x00000] in <filename unknown>:0


    Can I hope that LoadDynamicLibrary function will work fine in a future?
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,023
    Hi,

    the only thing that's not supported at this time is PInvoking into named dynamic libraries. Instead of specifying the name of native dynamic library, use "__Internal":

    Code (csharp):
    1.  
    2. [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
    3. private static extern int sqlite3_initialize();
    4.  
    That should work correctly - it will resolve function at link time than that at runtime.
     
  14. timintal

    timintal

    Joined:
    Jul 23, 2012
    Posts:
    8
    My app crushes every time I try to initialize Parse.
    Code (CSharp):
    1.  
    2. [B]MissingMethodException: Method not found: 'Default constructor not found...ctor() of Parse.PlatformHooks'.[/B]
    3.  
    4. [B]  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0 [/B]
    5.  
    6. [B]  at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0 [/B]
    7.  
    8. [B]  at Parse.ParseClient..cctor () [0x00000] in <filename unknown>:0 [/B]
    9.  
    10. [B]  at Parse.ParseInitializeBehaviour.Awake () [0x00000] in <filename unknown>:0 [/B]
    11.  
    12. [B]Rethrow as TypeInitializationException: The type initializer for 'Parse.ParseClient' threw an exception.[/B]
    13.  
    14. [B]  at Parse.ParseInitializeBehaviour.Awake () [0x00000] in <filename unknown>:0 [/B]
    15.  
    16.  
    17. [B](Filename: currently not available on il2cpp Line: -1)[/B]
    18.  
    ]

    The same error I had because of stripping and I fixed it with link file. But now I get this error even if stripping is disabled. So I have no clue how to fix this. Does IL2CPP supports System.Reflection at all? It seems like reflection is the problem here.
     
    Last edited: Jan 15, 2015
  15. Mantas-Puida

    Mantas-Puida

    Unity Technologies

    Joined:
    Nov 13, 2008
    Posts:
    1,859
    Currently IL2CPP always runs some kinds of stripping (to avoid unmanageable amount of code being generated), but there was issue that it was ignoring link.xml located at the Assets root folder. Fix for this part of the issue is on the way. At the moment you could hint about classes being needed by introducing dummy fields in one of your scripts.
     
  16. RalphH

    RalphH

    Unity Technologies

    Joined:
    Dec 22, 2011
    Posts:
    592
    Please file a bug with project so we can have a look.
     
  17. RalphH

    RalphH

    Unity Technologies

    Joined:
    Dec 22, 2011
    Posts:
    592
    It's looking for an array type that we can't infer at compile time. For now, you'll have to explicitly have a static field of that type of array in your code, so we can see it. We're working on both better messaging (already in for future build), and being able to construct new array types at runtime (not in yet).
     
  18. TristAAn

    TristAAn

    Joined:
    Jul 10, 2012
    Posts:
    8
    WARNINGS:

    Getting loads of these warnings in Xcode:
    Implicit conversion loses integer precision: 'uintptr_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int')

    mscorlib_System_DateTime L_1 = mscorlib_System_DateTime_m_ToUniversalTime(__this)
    Returns this warning:
    Integer constant is larger than the largest signed integer type

    ERRORS:

    String::New(char const*) at String.cpp:60:

    `il2cpp::utils::StringUtils::Utf16ToUtf8(unsigned short const*) at StringUtils.cpp:99
     
    Last edited: Jan 15, 2015
  19. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    168
    @TristAAn: the warnings are a known issue, but the error sounds like a bug. Could you file a bug so we can fix it? Thnx, Lucas
     
  20. sunxdc15

    sunxdc15

    Joined:
    Jan 2, 2014
    Posts:
    8
    hello guys,
    it's close to Apple's deadline, when will the official version with supporting ios 64 bit released? we planned submit our game to apple next week, it's better to submit a ios 64 bit version but now we are waiting unity.
    thanks.
     
    Last edited: Jan 16, 2015
  21. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,276
  22. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    I opened Support Case # 00170803: Crash in C# Platform Invoke code using IL2CPP with Unity 5.0.0b19

    I’m running Unity 5.0.0b19 to get support of arm64. The code compiled and linked ok and I can run either 32 bits or 64 bits Unity game on iPhone devices.

    But I run into crashes. I have following C# “struct Message”, there is a C# Platform Invoke interface NativeSessionSendMessage() to call native code from C# code. “struct Message” is a parameter of interface NativeSessionSendMessage().

    Every time the code crash at the line "marshaled.thumbnailUrl = il2cpp_codegen_marshal_string(unmarshaled.thumbnailUrl);” which is Frame 3 of following calling stack.

    I have tried following “struct Message” definitions and NativeSessionSendMessage() prototypes, they all have the same crash.

    The crash is both on armv7 and arm64 when I use IL2CPP with Unity 5.0.0b19. It seems C# struct with multiple string members are not marshaled correctly in C# Platform Invoke code with IL2CPP.

    When I was using old Unity 4.5 which does not have ARM64 support, the code works perfectly ok.

    I also tried Unity 4.6 Patch 3, this version does not generate iPhone project for me . Also tried Unity 5.0.0b18, it does not IL2CPP option. Finally Unity 5.0.0b19 IL2CPP works and I can generate iOS project, compile/link and run the code.

    #########

    [StructLayout (LayoutKind.Sequential)]

    publicstruct Message

    {

    public string description;

    public string thumbnailUrl;

    public string messageText;

    }



    ######### OR ######

    [StructLayout (LayoutKind.Sequential)]

    publicstruct Message

    {

    [MarshalAs(UnmanagedType.LPStr)]

    public string description;

    [MarshalAs(UnmanagedType.LPStr)]

    public string thumbnailUrl;

    [MarshalAs(UnmanagedType.LPStr)]

    public string messageText;

    }



    ############

    [DllImport (TANGO_SDK)]

    private static extern uint NativeSessionSendMessage(string[] recipients, Message m, int platformActionCount, byte[] callback);



    ############OR ######

    [DllImport (TANGO_SDK)]

    private static extern uint NativeSessionSendMessage(string[] recipients, [In, MarshalAs(UnmanagedType.LPStruct)] Message m, int platformActionCount, byte[] callback);



    ############backtrace on crash#####

    (lldb) bt

    * thread #1: tid = 0x25d79, 0x00cc7b04 UnityRock`il2cpp::utils::StringUtils::Utf16ToUtf8(utf16String=0x0000000c) + 68 at StringUtils.cpp:103, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)

    * frame #0: 0x00cc7b04 UnityRock`il2cpp::utils::StringUtils::Utf16ToUtf8(utf16String=0x0000000c) + 68 at StringUtils.cpp:103

    frame #1: 0x00cd4ee8 UnityRock`il2cpp::vm::platformInvoke::MarshalCSharpStringToCppString(managedString=<unavailable>) + 48 at PlatformInvoke.cpp:92

    frame #2: 0x001307f8 UnityRock`il2cpp_codegen_marshal_string(il2CppString=0x00000000) + 24 at il2cpp-codegen.h:378

    frame #3: 0x0016dab0 UnityRock`tango_sdk_unity_TangoSDK_Message_marshal(unmarshaled=0x0558f774, marshaled=0x0558f74c) + 52 at Bulk_tango_sdk_unity_0.cpp:9095

    frame #4: 0x0016e7ec UnityRock`tango_sdk_unity_TangoSDK_Message_marshaled il2cpp_codegen_struct_marshal_helper<tango_sdk_unity_TangoSDK_Message_marshaled, tango_sdk_unity_TangoSDK_Message>(unmarshaled=0x0558f774, marshalFunc=0x0016da7c)()) + 56 at il2cpp-codegen.h:488



    ######Frame 3.

    // Conversion methods for marshalling of: TangoSDK.Message

    void tango_sdk_unity_TangoSDK_Message_marshal(consttango_sdk_unity_TangoSDK_Message& unmarshaled, tango_sdk_unity_TangoSDK_Message_marshaled& marshaled)

    {

    marshaled.description = il2cpp_codegen_marshal_string(unmarshaled.description);

    marshaled.thumbnailUrl = il2cpp_codegen_marshal_string(unmarshaled.thumbnailUrl);**********

    marshaled.messageText = il2cpp_codegen_marshal_string(unmarshaled.messageText);



    }



    ######Frame 2.

    inlinechar* il2cpp_codegen_marshal_string(Il2CppCodeGenString* il2CppString)

    {

    returnil2cpp::vm::platformInvoke::MarshalCSharpStringToCppString((Il2CppString*)il2CppString);



    }



    ######Frame 1.

    0xcd4ee4: bl 0xcc7ac0 ; il2cpp::utils::StringUtils::Utf16ToUtf8(unsigned short const*) at StringUtils.cpp:100

    0xcd4ee8: movw r0, #0x2108

    0xcd4eec: ldr r1, [pc, #224] ; il2cpp::vm::platformInvoke::MarshalCSharpStringToCppString(Il2CppString*) + 284 at PlatformInvoke.cpp:98



    0xcd4ef0: movt r0, #0x8f



    ######Frame 0.

    0xcc7b00: add r0, pc, r2

    0xcc7b04: ldrh r5, [r6]



    0xcc7b08: str r1, [sp, #36]
     
    Last edited: Jan 16, 2015
  23. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    @huiyu:

    Do you ever have some null strings in your struct? This looks similar to the crash I reported earlier, which is that null strings don't get marshaled correctly. Passing empty strings is an acceptable workaround for me, but Unity has a proper fix coming up.
     
  24. tomtc123

    tomtc123

    Joined:
    Aug 22, 2014
    Posts:
    11
    Testing in ipad mini(ios7.0.4) with IL2CPP had some error :
    "This application does not support this device's cpu type" in my project, But when i create empty project and setting with IL2CPP, is work.
    Someone help me , please.@jonas echterhoff
     
  25. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
    I got this problem too.
    In XCode just switch the value "Build Active Architecture Only" to "Yes" and try again. (It's in BuildSettings, Architecture part)
    This must fix your issue.
     
    Last edited: Jan 16, 2015
  26. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    @paupawsan This bug has been corrected internally. It should make it into the next 4.6 release for iOS/il2cpp.
     
  27. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    @huiyu

    As @Frederic My mentioned, this looks very much like the null value marshaling bug. We have corrected that internally, and it should be out in the next 5.0 beta (b21, I think). I don't see a project with your support case, so I can't verify though. Please give this a try again with the next 5.0 beta. Thanks.
     
  28. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    Hi,

    I'm using Unity 4.6.1p3 and with IL2CPP enabled. My issue is I can't seem to be able to serialize or deserialize Nullable fields. I get this error:

    Is this a known issue? Any workarounds I can use?
     
  29. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    @ArjunN:

    Do the nullable fields happen to be enums which are backed by an unsigned type (like byte)? We have an existing, incorrect InvalidCastException involving types like that. A fix is in progress for that one. You can work around it by using a signed type to back the enum.

    If this is some other nullable type, then we'll probably need a project to reproduce and correct the issue. Can you submit a bug in this case?
     
  30. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    No, they are not enums. In fact the class I'm trying to serialize looks something like this:
    Code (CSharp):
    1. [Serializable]
    2. [XmlRoot(ElementName = "AssetRequest", Namespace = "")]
    3. public class AssetRequest
    4. {
    5.     [XmlElement(ElementName = "ProductID")]
    6.     public int? ProductID;
    7.  
    8.     [XmlElement(ElementName = "PlatformID")]
    9.     public int? PlatformID;
    10.          
    11.     [XmlElement(ElementName = "Locale")]
    12.     public string Locale;
    13.  
    14.     [XmlElement(ElementName = "AssetName")]
    15.     public string AssetName;
    16.  
    17.     [XmlElement(ElementName = "AppVersion")]
    18.     public string AppVersion;
    19. }
    The helper code that I use for serializing the object looks like this:
    Code (CSharp):
    1. public static string SerializeToString<T>(T obj)
    2.     {
    3.           StringWriter sw = new StringWriter();
    4.  
    5.           XmlSerializer serializer = new XmlSerializer(typeof(T));
    6.           serializer.Serialize(sw, obj);
    7.  
    8.           return sw.ToString();
    9.     }
    And I'm trying to serialize using the above call via this:
    string serialized = SerializeToString<AssetRequest>(request); //request is an instance of type AssetRequest

    I could submit a bug report if that will help!
     
  31. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    @ArjunN

    Yes, please submit a bug report. We should be able to handle this case, I think. Thanks.
     
  32. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    Ok, I will create a simple unity project with the above example and try to submit that.
     
  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    Thanks @ArjunN. Please mention the bug number here so that we can quickly find it.
     
  34. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    JoshPeterson and Frederic:

    Thanks for the information, I replace null string with empty string, the crash disappeared and my code goes further.

    Now the code crashes at another parameter which is an array of struct PlatformActionPair, the IL2CPP code crash at il2cpp_codegen_marshal_struct_array().

    My Pinvoke interface looks like following, the array of struct parameter is "[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct, SizeParamIndex = 3)] PlatformActionPair[] platformActionArr"

    [StructLayout (LayoutKind.Sequential)]

    public struct PlatformActionPair
    {
    public Platform platform;
    public string prompt;
    publicstring url;
    public string mimeType;
    }

    [DllImport (TANGO_SDK)]
    private static extern uint NativeSessionSendMessage(string[] recipients, int recipients_size, Message m, int platformActionCount, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct, SizeParamIndex = 3)] PlatformActionPair[] platformActionArr, byte[] callback);

    ########Frame 1
    template <typename ElementType>
    inline ElementType* il2cpp_codegen_marshal_struct_array(Il2CppCodeGenArray* a)
    {
    return il2cpp::vm::platformInvoke::MarshalStructArray<ElementType>((Il2CppArray*)a);
    }

    #########Frame 0
    template <typename ElementType>
    static ElementType* MarshalStructArray(Il2CppArray* a)
    {
    TypeInfo* type = a->obj.klass->element_class;
     
  35. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,023
    @huiyu - how does it crash? Could you copy paste the generated "_marshal" function that's in the callstack of the crash? A bug report would be nice.
     
  36. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Tautvydas:

    With 5.0.0b19, the last two frames of the crash are following. It crash in function MarshalStructArray().

    I would like to go back and get complete stack for you, but I just upgrade my Unity from 5.0.0b19 to 5.0.0b20, The crash looks different from before.


    ########Frame 1
    template <typename ElementType>
    inline ElementType* il2cpp_codegen_marshal_struct_array(Il2CppCodeGenArray* a)
    {
    return il2cpp::vm::platformInvoke::MarshalStructArray<ElementType>((Il2CppArray*)a);
    }

    #########Frame 0
    template <typename ElementType>
    static ElementType* MarshalStructArray(Il2CppArray* a)
    {
    TypeInfo* type = a->obj.klass->element_class; *******CRASH HERE********
     
    Last edited: Jan 17, 2015
  37. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,023
    Could you post some more details on the crash on b20? Or does it work on b20?
     
  38. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    In 5.0.0b20, the crash does not make too much sense to me, it seems it crashed much earlier than in 5.0.0b19.

    Following is Frame 0, 1, 2 and complete back trace.

    Thanks.

    #######Both Frame 0 and Frame 1
    #include "mscorlib_System_Reflection_DefaultMemberAttributeMethodDeclarations.h"
    void tango_sdk_unity_SimpleJSON_JSONNode_CustomAttributesCacheGenerator(CustomAttributesCache* cache)
    {
    cache->attributes = (Il2CppObject**)il2cpp_gc_alloc_fixed(sizeof(mscorlib_System_Object *) * cache->count, 0);
    {
    mscorlib_System_Reflection_DefaultMemberAttribute * tmp;
    tmp = (mscorlib_System_Reflection_DefaultMemberAttribute *)il2cpp_codegen_object_new (&mscorlib_System_Reflection_DefaultMemberAttribute_il2cpp_TypeInfo);
    mscorlib_System_Reflection_DefaultMemberAttribute_m__ctor(tmp, il2cpp_codegen_string_new_wrapper("Item"));
    cache->attributes[0] = (Il2CppObject*)tmp;
    }
    }

    ######Frame 2
    template <typename R, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
    struct VirtFuncInvoker6
    {
    typedef R (*Func)(void*, T1, T2, T3, T4, T5, T6);
    static inline R Invoke (MethodInfo* method, void* obj, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6)
    {
    VirtualInvokeData data = il2cpp::vm::Runtime::GetVirtualInvokeData (method, obj);
    return ((Func)data.methodInfo->method)(data.target, p1, p2, p3, p4, p5, p6);
    }
    };

    #######complete back trace#########
    (lldb) bt
    * thread #1: tid = 0x43ae4, 0x0147c1cc UnityRock`tango_sdk_unity_SimpleJSON_JSONNode_CustomAttributesCacheGenerator(cache=0x00000000) + 20307348 at Bulk_tango_sdk_unity_0.cpp:2139, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)

    * frame #0: 0x0147c1cc UnityRock`tango_sdk_unity_SimpleJSON_JSONNode_CustomAttributesCacheGenerator(cache=0x00000000) + 20307348 at Bulk_tango_sdk_unity_0.cpp:2139

    frame #1: 0x0147c0ec UnityRock`tango_sdk_unity_SimpleJSON_JSONNode_CustomAttributesCacheGenerator(cache=0x0ae95428) + 20307124 at Bulk_tango_sdk_unity_0.cpp:2138

    frame #2: 0x0011fb00 UnityRock`VirtFuncInvoker6<unsigned int, mscorlib_System_String_arr*, int, tango_sdk_unity_TangoSDK_Message, int, tango_sdk_unity_TangoSDK_PlatformActionPair_arr*, mscorlib_System_Byte_arr*>::Invoke(method=0x018c81b4, obj=0x0a06dfc0, p1=0x078c2a38, p2=1, p3=tango_sdk_unity_TangoSDK_Message at 0x0553b73c, p4=0, p5=0x00000000, p6=0x0ae770d8) + 204 at GeneratedVirtualInvokers.h:141

    frame #3: 0x01475e40 UnityRock`tango_sdk_unity_SimpleJSON_JSONClass_CustomAttributesCacheGenerator_tango_sdk_unity_SimpleJSON_JSONClass_m_GetEnumerator(cache=0x015dffc8) + 20280296 at Bulk_tango_sdk_unity_0.cpp:5122

    frame #4: 0x000c4d70 UnityRock`InterfaceFuncInvoker6<unsigned int, mscorlib_mscorlib_System_Collections_Generic_List_1_mscorlib_System_String_git*, mscorlib_System_String*, mscorlib_System_String*, mscorlib_System_String*, mscorlib_mscorlib_System_Collections_Generic_Dictionary_2_tango_sdk_unity_TangoSDK_PlatformU002CU0020tango_sdk_unity_TangoSDK_MessagingAction_git*, tango_sdk_unity_TangoSDK_TangoDelegate*>::Invoke(method=0x018c6fd4, obj=0x0a06dfc0, p1=0x0aeb4a80, p2=0x0ae76540, p3=0x00000000, p4=0x0ae95428, p5=0x00000000, p6=0x0ac74380) + 152 at GeneratedInterfaceInvokers.h:141

    frame #5: 0x011b3f2c UnityRock`AssemblyU002DCSharp_UnityRockTest_U003CLoadImageU003Ec__Iterator0_CustomAttributesCacheGenerator_AssemblyU002DCSharp_UnityRockTest_U003CLoadImageU003Ec__Iterator0_m_System_Collections_Generic_IEnumeratorU003CobjectU003E_get_Current(cache=0x0553b8d4) + 17758296 at Bulk_Assembly-CSharp_0.cpp:3395

    frame #6: 0x011bea30 UnityRock`AssemblyU002DCSharp_TangoSDK_SessionFactory_m_uninit(__this=0x00000000) - 18446744073690944975

    frame #7: 0x011c3c84 UnityRock`AssemblyU002DCSharp_TangoSDK_SessionFactory_m_init(__this=0x0553c1c4, appName=0x0a063f18, callbackScheme=0x0aeb2438, eventListener=0x00000004, forwardUploadDetailsListener=0x0a095f78) - 18446744073690923899

    frame #8: 0x001209dc UnityRock`RuntimeInvoker_mscorlib_System_Void(method=0x015dffc8, obj=0x0a063f18, args=0x0553bef8) + 60 at GeneratedInvokers.cpp:12

    frame #9: 0x00c947a8 UnityRock`il2cpp::vm::Runtime::Invoke(MethodInfo*, void*, void**, Il2CppObject**) + 156

    frame #10: 0x004a3348 UnityRock`Invoke + 196 at ScriptingInvocationNoArgs.cpp:99

    frame #11: 0x004999fc UnityRock`DoGUI + 540 at MonoBehaviour.cpp:391

    frame #12: 0x003e9950 UnityRock`DoGUIEvent [inlined] DoGUI + 36 at GUIManager.h:74

    frame #13: 0x003e992c UnityRock`DoGUIEvent + 1628 at GUIManager.cpp:361

    frame #14: 0x003ea070 UnityRock`SendQueuedEvents + 356 at GUIManager.cpp:146

    frame #15: 0x0042ea28 UnityRock`PlayerLoop + 2296 at Player.cpp:1833

    frame #16: 0x00192dbc UnityRock`UnityPlayerLoopImpl + 20 at LibEntryPoint.mm:210

    frame #17: 0x00093b64 UnityRock`UnityRepaint + 248 at UnityAppController+Rendering.mm:199

    frame #18: 0x00093a64 UnityRock`-[UnityAppController(self=0x14799d10, _cmd=0x011a8546) repaint] + 152 at UnityAppController+Rendering.mm:48

    frame #19: 0x000939c4 UnityRock`-[UnityAppController(self=0x14799d10, _cmd=0x011a84dc) repaintDisplayLink] + 100 at UnityAppController+Rendering.mm:39

    frame #20: 0x0571a182 libglInterpose.dylib`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270

    frame #21: 0x2db86802 QuartzCore`CA::Display::DisplayLinkItem::dispatch() + 98

    frame #22: 0x2db8666a QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366

    frame #23: 0x3246c82a IOMobileFramebuffer`IOMobileFramebufferVsyncNotifyFunc + 90

    frame #24: 0x2bb764e0 IOKit`IODispatchCalloutFromCFMessage + 256

    frame #25: 0x2ac060a4 CoreFoundation`__CFMachPortPerform + 132

    frame #26: 0x2ac16572 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34

    frame #27: 0x2ac1650e CoreFoundation`__CFRunLoopDoSource1 + 346

    frame #28: 0x2ac14b10 CoreFoundation`__CFRunLoopRun + 1608

    frame #29: 0x2ab623c0 CoreFoundation`CFRunLoopRunSpecific + 476

    frame #30: 0x2ab621d2 CoreFoundation`CFRunLoopRunInMode + 106

    frame #31: 0x31f600a8 GraphicsServices`GSEventRunModal + 136

    frame #32: 0x2e171fa0 UIKit`UIApplicationMain + 1440

    frame #33: 0x00084ec4 UnityRock`main(argc=1, argv=0x0553ea6c) + 324 at main.mm:38

    (lldb)
     
  39. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    I go back to b19, the crash is at

    template <typename ElementType>
    static ElementType* MarshalStructArray(Il2CppArray* a)
    {
    TypeInfo* type = a->obj.klass->element_class; *******CRASH HERE********
    typedef void(*MarshalFunc)(void*, void*);
    MarshalFunc marshalFunc = (MarshalFunc)type->marshal_to_native_func;
    if (marshalFunc != NULL)
    {
    size_t size = Array::GetLength(a);
    ElementType* marshaledArray = (ElementType*)MarshalAlloc::Allocate(size * sizeof(ElementType));
    for (size_t i = 0; i < size; ++i)
    {
    void* managedElement = il2cpp_array_addr_with_size(a, type->native_size, i);
    MarshalStructToNative(managedElement, &marshaledArray, type);
    }
    return marshaledArray;
    }
    return MarshalArray<ElementType>(a);
    }
     
  40. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    4,876
    Is there a chance that the array argument is null here? We had a bug with null arrays similar to the bug with null strings. The fix did not make it into 5.0b20, I think. As @Tautvydas Zilys mentioned, could you submit a bug with the project that causes this crash? Then we can debug the problem and correct it if we have not done so already. Thanks.
     
  41. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Thanks, it is the null array argument problem.

    If I make non-null array, then it works and no crash.

    Thanks a lot. Hope this can be fixed in next release along with the null string problem.
     
  42. TristAAn

    TristAAn

    Joined:
    Jul 10, 2012
    Posts:
    8
    This is really an ambicious upgrade, my gut feeling is we won't meet the Apple deadline and missing out on even more revenue. I am dealing with 100's of errors and it will require more refactoring on our part.

    Is Unity3D assuming that all customers are required to refactor as part of this upgrade? Because that is a cost we did not factor in when becoming a Unity3D customer.

    I would expect that the 4.6.X official upgrade would be as seamless as switching to IL2CPP and deploy to Xcode without refactoring anything.
     
  43. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Sorry I can not submit the whole project to you, the size of my Unity project is pretty significant (over 250MB), it is not feasible for you to build/run it.
     
  44. TristAAn

    TristAAn

    Joined:
    Jul 10, 2012
    Posts:
    8
    I guess Unity3D guys are on holiday for the weekend.. Somehow I feel they are not taking this too seriously, any one agree? I mean the whole reason we bought this platform was the confidence that it would be supported and not be in this situation. I beg the question why this is such an issue, where is the leadership? Unity3D must have seen this coming many months ago but we are all struggling to get this over the line.
     
    Last edited: Jan 17, 2015
  45. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,276
    No, I don't agree. I can't imagine why you think they're not taking it seriously, or why you think they would know Apple's plans ahead of anyone else. Honestly I wasn't expecting they'd be as far along as they are; they're dealing with the situation quite well by any realistic standard.

    --Eric
     
  46. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    Josh, I have filed a bug report (664066) for the issue.
     
  47. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,408
    No. By and large, if your project works correctly under Mono AOT, the intention is that it should work correctly under IL2CPP with no changes.

    What are the 100s of errors you are seeing?
     
  48. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,408
    250MB is pretty small by our usual standards :) If it's too big to attach to the bug reporter, you can either include details about how to access it in your bug report, or PM me and I'll arrange access to our blind FTP drop for you.
     
  49. MmmCurry

    MmmCurry

    Joined:
    May 12, 2014
    Posts:
    4
    On .NET API support: Is there an equivalent to http://docs.unity3d.com/410/Documentation/ScriptReference/MonoCompatibility.html for iOS+IL2CPP, an existing column in the above that happens to be identical, or a short summary of the supported APIs somewhere? So far all I see is "WebRequest isn't there yet, and Reflection.Emit will kill you."

    I have some System.Security and System.Remoting calls failing with hard-to-interpret memory errors, and it would be nice to have a place to look to see whether the APIs are supported or not before deciding I have a different cause or a bug worth reporting. Thanks much.
     
    Last edited: Jan 17, 2015
  50. michael-v

    michael-v

    Joined:
    Jun 21, 2013
    Posts:
    19
    After removing some enums and all Prime31 GameCenter code (thou i updated plugin - still didn't work), i'm was receiving this in debug build:

    Code (CSharp):
    1. ld: b/bl/blx ARM branch out of range (35913016 max is +/-32MB): from __Z181AssemblyU002DCSharpU002Dfirstpass_AGSAchievementsClient_CustomAttributesCacheGenerator_AssemblyU002DCSharpU002Dfirstpass_AGSAchievementsClient_UpdateAchievementFailedEvent_EventInfoP21CustomAttributesCache (0x0002FA1C) to
    after removing corresponding code i'm still receiving:

    Code (CSharp):
    1. ld: b/bl/blx ARM branch out of range (35804040 max is +/-32MB): from __Z142AssemblyU002DCSharpU002Dfirstpass_AotSafe_CustomAttributesCacheGenerator_AssemblyU002DCSharpU002Dfirstpass_AotSafe_m_U003CForEach_1U003Em__0_1P21CustomAttributesCache (0x00031724) to
    This doesn't happen in release builds.
     
unityunity