Search Unity

4.6 iOS 64-bit beta

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

  1. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    Thanks ArjunN, we will have a look at this bug.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @TristAAn, I'm sorry that you're receiving the support you expect. I can assure that many people at Unity have been (and will continue to) work very hard to solve as many problems as we can.

    If possible, can you submit a bug and include the project which is causing the errors? That will likely be your quickest route to a resolution. If you cannot share the project with us, can you provide more details about the specific errors you are seeing?
    • Do they occur when IL2CPP is converting IL to C++?
    • Are they coming from Xcode when it compiles the C++?
    • Are they runtime errors or exceptions that prevent your project from functioning correctly?

    Thanks, we appreciate your help.
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @MmmCurry We're not yet where we want to be with documentation. It will be improved, but we don't have a compatibility list yet. As a guideline, we plan to support everything that Mono AOT supports currently.

    A good litmus test for a problem is "Does this project work with an iOS/Mono build?" If it does, then is should work with iOS/IL2CPP as well. If it does not work with iOS/IL2CPP, then it is likely a bug we need to investigate.

    Specifically, System.Security and System.Remoting should be working correctly. Our internal builds have WebRequest working as well, so expect that in an upcoming release. As with Mono AOT, System.Reflection.Emit is not supported by IL2CPP.
     
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @genius-fx This is a particularly ugly bug that we are working to correct now. Clang is emitting a branch instruction that is limited to a 32 MB branch (as the linker error says). ARM does have a longer branch instruction, but the versions of clang with the latest Xcode are not able to emit it as far as we can tell. The problem shows up in what seems to be an arbitrary way, depending on the layout of the code.

    There are a few possible work arounds, but none of them work in all cases:
    • This problem does show up more often in debug builds (as in your case) but we have seen it in release builds as well. If you can build in release, go with that.
    • If you need a debug build, try building for only the ARM64 architecture (instead of a Universal binary) sometimes this will allow the linker to succeed.
    • If you are debugging a problem and have some idea about where the problem exists, try to remove unrelated parts of the project. Making the executable size smaller will often avoid this problem.
    I hope these suggestions help until we can solve this problem. Thanks.
     
  5. michael-v

    michael-v

    Joined:
    Jun 21, 2013
    Posts:
    19
    Thank you. It is compiling in release and even something does run! :) We have huge project and i think we will catch a lot of errors. Right now it fail somewhere in JSON deserializer with this error:

    Code (CSharp):
    1. [3.9911 +0.0084] Method not found: 'Default constructor not found...ctor() of System.ComponentModel.Int64Converter'.
    2.   at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <filename unknown>:0
    3.   at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x00000] in <filename unknown>:0
    4.   at Pathfinding.Serialization.JsonFx.TypeCoercionUtility.CoerceType (System.Type targetType, System.Object value) [0x00000] in <filename unknown>:0
    5.   at Pathfinding.Serialization.JsonFx.JsonReader.ReadNumber (System.Type expectedType) [0x00000] in <filename unknown>:0
    6.   at Pathfinding.Serialization.JsonFx.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] in <filename unknown>:0
    7.   at Pathfinding.Serialization.JsonFx.JsonReader.PopulateObject (System.Object& result, System.Type objectType, System.Collections.Generic.Dictionary`2 memberMap, System.Type genericDictionaryType) [0x00000] in <filename unknown>:0
    It seems not all ComponentModel is present, or may be it was stripped, even thou it present in link.xml
     
  6. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    Hi, I'm unity used in the database is NOSQL database iboxDB, the previous version are all no problem, when I use the latest version of 4.6.1.p3 to compile the 64 bit IOS is wrong.
     
  7. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @genius-fx
    I actually doubt this is a stripping issue. It is more likely related to an AOT limitation. IL2CPP can only construct and instance of a type at runtime that it knows about at compile time. So for a call to System.Activator.CreateInstance to succeed, IL2CPP needs to have previously generated code for the System.Type passed as the first argument to CreateInstance.

    You may be able to work around this issue by declaring an unused field of type System.ComponentModel.Int64Converter in a class that will not be stripped. A MonoBehaviour in one of your scripts is likely a good candidate. Maybe try something like this:

    Code (CSharp):
    1. class AotTypes : MonoBehaviour
    2. {
    3.     private static System.ComponentModel.Int64Converter _unused = new System.ComponentModel.Int64Converter();
    4. }
    This is obviously not ideal, but hopefully it will be an acceptable workaround. We are currently looking at a few way we can avoid the need for a workaround like this, but nothing is ready yet.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @taecg
    Could you provide more information about the problem? Is the code failing in p/invoke calls to native code? If possible, we like to have a bug report with a project to reproduce the problem. Thanks.
     
  9. MmmCurry

    MmmCurry

    Joined:
    May 12, 2014
    Posts:
    4
    This helps a lot and gives me some direction for troubleshooting. Thanks for the clarification!
     
  10. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74

    Sorry for the delay. I tried ljmeier's suggestion but it didn't help. I'll try to get a sample reproducing project done soon. We happened to finish our game so we could release it as 32bit
     
  11. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    Frederic,

    The lags from GC pauses should be fixed in a future beta release.

    Thanks,
    Jonathan
     
  12. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
    Thanks @joncham we saw this issue in our previous builds !
    Keep going guys, you did well !
     
  13. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    That's awesome!

    Sorry I didn't get back to you on this with more details, I haven't had the opportunity to test it more. I've mostly been testing 3rd party libraries I use (when I'm not on non-IL2CPP related tasks of course), so far so good.
    I'll make sure to try the next beta releases as they come up. Thanks!
     
  14. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    I worked around the first Serialization problem so I am not addressing it this time, but I have made a sample app reproducing the second problem. Bug report case is 664604.
     
  15. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
    I just want to know when will you release the p4 IL2CPP unity version ? Or maybe you'll release it in a later patch ?
     
  16. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @Umai

    Thanks for the bug, we will have a look at it.
     
  17. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    If you have your game ready, then the best solution is to submit now with mono scripting backend and then start upgrading to il2cpp backend.
     
  18. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Glad to know 250MB size is not the problem. There is still one more problem that, to run my App, there is specific dependency and procedures you have to follow, this exist in my test environment, but it would be difficult for you to duplicate my environment.

    Thanks anyway.
     
  19. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    Hi, I have another C# PInvoke problem to report.

    I have a struct ContentMessage which is one of the PInvoke parameter. There are two data member thumbnailDataPtr and contentDataPtr, if their type is “byte[]”, PInvoke will crash. If their type is “string”, there would be NO crash.

    Before IL2CPP, “byte[]” as struct member is OK.

    I have been careful, thumbnailDataPtr and contentDataPtr are not null byte array.

    ############# With IL2CPP, “byte[]” as struct member causes crash#######

    [StructLayout (LayoutKind.Sequential)]
    public struct ContentMessage
    {
    public string description;
    public string thumbnailUrl;
    public string messageText;
    public string thumbnailMimeType;
    public byte[] thumbnailDataPtr;
    public int thumbnailDataLength;
    public string contentMimeType;
    public byte[] contentDataPtr;
    public int contentDataLength;
    public string contentActionPrompt;
    public bool hasConverter;
    }

    ############# With IL2CPP, “string” as struct member is OK #######
    [StructLayout (LayoutKind.Sequential)]
    public struct ContentMessage
    {
    public string description;
    public string thumbnailUrl;
    public string messageText;
    public string thumbnailMimeType;
    public string thumbnailDataPtr;
    public int thumbnailDataLength;
    public string contentMimeType;
    public string contentDataPtr;
    public int contentDataLength;
    public string contentActionPrompt;
    public bool hasConverter;
    }
    ############## PInvoke API, “struct ContentMessage” is a parameter.
    [DllImport (TANGO_SDK)]
    private static extern uint NativeSessionSendMessageWithContent(string[] recipients, int recipients_size, ContentMessage m, byte[] callback);

    ###########Frame 0, 1, 2 of the crash#########

    #########Frame 0######

    error: memory read failed for 0x0


    #########Frame 1#####



    template <typename TMarshaled, typename TUnmarshaled>

    inline TMarshaled il2cpp_codegen_struct_marshal_helper(const TUnmarshaled& unmarshaled, methodPointerType marshalFunc)

    {

    typedef void(*marshalFuncType)(const TUnmarshaled&, TMarshaled&);

    TMarshaled marshaled;

    ((marshalFuncType)marshalFunc)(unmarshaled, marshaled);

    return marshaled;

    }



    #########Frame 2#######

    static Il2CppCodeGenString* il2cpp_codegen_string_new_wrapper (const char* str)

    {

    return (Il2CppCodeGenString*)il2cpp::vm::String::NewWrapper (str);

    }



    ########## complete backtrace of the crash#########

    (lldb) bt

    * thread #1: tid = 0x90267, 0x00000000, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)

    frame #0: 0x00000000

    * frame #1: 0x000a55fc ProductName`tango_sdk_unity_TangoSDK_ContentMessage il2cpp_codegen_struct_marshal_helper<tango_sdk_unity_TangoSDK_ContentMessage, tango_sdk_unity_TangoSDK_ContentMessage>(unmarshaled=0x054c938c, marshalFunc=0x00000000)()) + 56 at il2cpp-codegen.h:488

    frame #2: 0x01410dfc ProductName`il2cpp_codegen_string_new_wrapper(str=0x08a59d68) + 20369880 at il2cpp-codegen.h:114

    frame #3: 0x01410cb4 ProductName`tango_sdk_unity_SimpleJSON_JSONArray_U003CGetEnumeratorU003Ec__Iterator3_CustomAttributesCacheGenerator(cache=0x102fa000) + 20369520 at Bulk_tango_sdk_unity_0.cpp:2780

    frame #4: 0x000a50b0 ProductName`VirtFuncInvoker4<unsigned int, mscorlib_System_String_arr*, int, tango_sdk_unity_TangoSDK_ContentMessage, mscorlib_System_Byte_arr*>::Invoke(method=0x01860068, obj=0x0e27cfc0, p1=0x08a5a870, p2=1, p3=tango_sdk_unity_TangoSDK_ContentMessage at 0x054c9554, p4=0x102d6120) + 428 at GeneratedVirtualInvokers.h:108

    frame #5: 0x0140a9fc ProductName`tango_sdk_unity_TangoSDK_Response_marshal_cleanup(marshaled=0x102b46e8) + 20340356 at Bulk_tango_sdk_unity_0.cpp:11175

    frame #6: 0x00048058 ProductName`InterfaceFuncInvoker11<unsigned int, mscorlib_mscorlib_System_Collections_Generic_List_1_mscorlib_System_String_git*, mscorlib_System_String*, mscorlib_System_String*, mscorlib_System_String*, mscorlib_System_Byte_arr*, mscorlib_System_String*, mscorlib_System_Byte_arr*, mscorlib_System_String*, tango_sdk_unity_TangoSDK_ContentConverterCallback*, mscorlib_System_String*, tango_sdk_unity_TangoSDK_TangoDelegate*>::Invoke(method=0x0185ef0c, obj=0x0e27cfc0, p1=0x102eb3a8, p2=0x102b46e8, p3=0x00000000, p4=0x00000000, p5=0x00000000, p6=0x10282168, p7=0x102fa000, p8=0x102bfe40, p9=0x00000000, p10=0x101913f0, p11=0x1008d2d8) + 236 at GeneratedInterfaceInvokers.h:152

    frame #7: 0x0112ea38 ProductName`AssemblyU002DCSharp_UnityRockTest_U003CLoadImageU003Ec__Iterator0_CustomAttributesCacheGenerator_AssemblyU002DCSharp_UnityRockTest_U003CLoadImageU003Ec__Iterator0_m_System_Collections_IEnumerator_get_Current(cache=0x10282168) + 17723676 at Bulk_Assembly-CSharp_0.cpp:3406

    frame #8: 0x0113a5a4 ProductName`AssemblyU002DCSharp_TangoSDK_SessionFactory_m_sendMessageToRecipients_mscorlib_System_UInt32_mscorlib_System_Collections_Generic_List_1_git__mscorlib_System_String_mscorlib_System_String_mscorlib_System_String_mscorlib_System_String_mscorlib_System_Byte_arr1_mscorlib_System_String_mscorlib_System_Byte_arr1_mscorlib_System_String_tango_sdk_unity_TangoSDK_ContentConverterCallback_mscorlib_System_String_tango_sdk_unity_TangoSDK_TangoDelegate(__this=0x102f15a0, recipients=0x0000000f, description=0x00000216, thumbnailUrl=0x00000000, thumbnailMimeType=0x00000000, thumbnailData=0x00000000, contentMimeType=0x00000000, contentData=0x00000000, actionPrompt=0x00000000, converter=0x3b08a4ec, messageText=0x00000018, callback=0x0609623d) - 18446744073691486811

    frame #9: 0x0113f3f8 ProductName`AssemblyU002DCSharp_TangoSDK_SessionFactory_m_init(__this=0x054ca244, appName=0x0e272f18, callbackScheme=0x102f15a0, eventListener=0x00000004, forwardUploadDetailsListener=0x0e2a3f78) - 18446744073691466759

    frame #10: 0x000a58b4 ProductName`RuntimeInvoker_mscorlib_System_Void(method=0x01577e04, obj=0x0e272f18, args=0x054ca068) + 60 at GeneratedInvokers.cpp:12

    frame #11: 0x00c0f674 ProductName`il2cpp::vm::Runtime::Invoke(MethodInfo*, void*, void**, Il2CppObject**) + 156

    frame #12: 0x0041dc44 ProductName`Invoke + 196 at ScriptingInvocationNoArgs.cpp:99

    frame #13: 0x00414490 ProductName`DoGUI + 344 at MonoBehaviour.cpp:391

    frame #14: 0x0036ceb0 ProductName`DoGUIEvent [inlined] DoGUI + 36 at GUIManager.h:74

    frame #15: 0x0036ce8c ProductName`DoGUIEvent + 1628 at GUIManager.cpp:361

    frame #16: 0x0036d5d0 ProductName`SendQueuedEvents + 356 at GUIManager.cpp:146

    frame #17: 0x003b1938 ProductName`PlayerLoop + 2296 at Player.cpp:1927

    frame #18: 0x00117e60 ProductName`UnityPlayerLoopImpl + 20 at LibEntryPoint.mm:210

    frame #19: 0x000171f4 ProductName`UnityRepaint + 40 at UnityAppController+Rendering.mm:202

    frame #20: 0x000171c4 ProductName`-[UnityAppController(self=0x08ba9060, _cmd=0x01122f06) repaint] + 152 at UnityAppController+Rendering.mm:50

    frame #21: 0x00017044 ProductName`-[UnityAppController(self=0x08ba9060, _cmd=0x01122e9c) repaintDisplayLink] + 196 at UnityAppController+Rendering.mm:39

    frame #22: 0x056a8182 libglInterpose.dylib`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 270

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

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

    frame #25: 0x3246c82a IOMobileFramebuffer`IOMobileFramebufferVsyncNotifyFunc + 90

    frame #26: 0x2bb764e0 IOKit`IODispatchCalloutFromCFMessage + 256

    frame #27: 0x2ac060a4 CoreFoundation`__CFMachPortPerform + 132

    frame #28: 0x2ac16572 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34

    frame #29: 0x2ac1650e CoreFoundation`__CFRunLoopDoSource1 + 346

    frame #30: 0x2ac14b10 CoreFoundation`__CFRunLoopRun + 1608

    frame #31: 0x2ab623c0 CoreFoundation`CFRunLoopRunSpecific + 476

    frame #32: 0x2ab621d2 CoreFoundation`CFRunLoopRunInMode + 106

    frame #33: 0x31f600a8 GraphicsServices`GSEventRunModal + 136

    frame #34: 0x2e171fa0 UIKit`UIApplicationMain + 1440

    frame #35: 0x00008654 ProductName`main(argc=1, argv=0x054cca68) + 324 at main.mm:38

    (lldb)
     
  20. jeffsherwin

    jeffsherwin

    Joined:
    Aug 22, 2014
    Posts:
    47
  21. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,659
    jeffsherwin likes this.
  22. colargol

    colargol

    Joined:
    Mar 31, 2010
    Posts:
    65
    Hi, is performance and level loading time something which is planned to be improved in next patch releases? Now I have 1.6 x longer level loading times and 5 to 10 FPS less for IL2CPP build (compared to Mono build, both ARM64 and ARM7 devices)
     
  23. invicticide

    invicticide

    Joined:
    Nov 15, 2009
    Posts:
    109
    I'm probably just missing something obvious, but is there a reliable way to verify on-device that the running build is in fact 64-bit, and not 32-bit like we've been deploying thus far?

    I've been able to build, deploy, and run successfully, but I'd feel much better if I could prove that I'm actually running 64-bit. ;)
     
  24. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    I had the same thought. If you already have some native code in your project, or are familiar with plugin development, you can just add something like this:

    extern "C" int _processorBits()
    {
    if(sizeof(void*) == 4)
    return 32;
    if(sizeof(void*) == 8)
    return 64;
    return 0;
    }

    I call this function from C#, and display either "32b" or "64b" under my frame rate counter. Shows 32b on my iPad 3rd gen, 64b on iPhone 6, looks good to me :)
     
  25. michael-v

    michael-v

    Joined:
    Jun 21, 2013
    Posts:
    19
    I've managed to produce pre-alpha quality runnable build of our project, it still crashes in random places, but many thinks are working already. Main problems that i had to circumvent and/or disable:

    1) Prime31 GameCenter plugin didn't link even after update
    2) Had to add explicit mentioning of types from ComponentModel in order for JSON deserializer to work (big thank to Unity admin that pointed out the solution). I think IL2CPP should take types from link.xml and add them itself, but right now it does not:

    Code (CSharp):
    1.     private static System.ComponentModel.Int64Converter _unused = new System.ComponentModel.Int64Converter();
    2.     private static System.ComponentModel.DecimalConverter _unused2 = new System.ComponentModel.DecimalConverter();
    3.     private static System.ComponentModel.ByteConverter _unused3 = new System.ComponentModel.ByteConverter();
    4.     private static System.ComponentModel.CollectionConverter _unused4 = new System.ComponentModel.CollectionConverter();
    5.     private static System.ComponentModel.CharConverter _unused5 = new System.ComponentModel.CharConverter();
    6.     private static System.ComponentModel.SByteConverter _unused6 = new System.ComponentModel.SByteConverter();
    7.     private static System.ComponentModel.Int16Converter _unused7 = new System.ComponentModel.Int16Converter();
    8.     private static System.ComponentModel.UInt16Converter _unused8 = new System.ComponentModel.UInt16Converter();
    9.     private static System.ComponentModel.Int32Converter _unused9 = new System.ComponentModel.Int32Converter();
    10.     private static System.ComponentModel.UInt32Converter _unused10 = new System.ComponentModel.UInt32Converter();
    11.     private static System.ComponentModel.Int64Converter _unused11 = new System.ComponentModel.Int64Converter();
    12.     private static System.ComponentModel.UInt64Converter _unused12 = new System.ComponentModel.UInt64Converter();
    13.     private static System.ComponentModel.DoubleConverter _unused13 = new System.ComponentModel.DoubleConverter();
    14.     private static System.ComponentModel.SingleConverter _unused14 = new System.ComponentModel.SingleConverter();
    15.     private static System.ComponentModel.BooleanConverter _unused15 = new System.ComponentModel.BooleanConverter();
    16.     private static System.ComponentModel.StringConverter _unused16 = new System.ComponentModel.StringConverter();
    17.     private static System.ComponentModel.DateTimeConverter _unused17 = new System.ComponentModel.DateTimeConverter();
    18.     private static System.ComponentModel.EnumConverter _unused18 = new System.ComponentModel.EnumConverter(typeof(<any your enum>));
    19.     private static System.ComponentModel.TimeSpanConverter _unused19 = new System.ComponentModel.TimeSpanConverter();
    3) Reflection did't work! Here's relevant stack trace: http://monosnap.com/image/Lp8mOsb8soix0sixF2nRI2W6HKJIBu . I can share relevant code to Unity's admin in pm. But in essence it just looks for fields with certain Attribute in class and change their value.

    4) IsDefined on enum always produced ArgumentException:

    Code (CSharp):
    1. ArgumentException: The value parameter is not the correct type.It must be type String or the same type as the underlying typeof the Enum.
    2.   at System.Enum.get_underlying_type (System.Type enumType) [0x00000] in <filename unknown>:0
    The code is trivial:
    Code (CSharp):
    1.   public static bool TryParse<TEnum>(object value, out TEnum val)
    2.   {
    3.     val = default(TEnum);
    4.     Type enumType = typeof(TEnum);
    5.     if (!enumType.IsEnum) return false;
    6.     string strValue = value.ToString();
    7.  
    8.         // This line FAILS in IL2CPP
    9.     if (!Enum.IsDefined(enumType, value)) return false;
    10.  
    11.     val = (TEnum)Enum.Parse(enumType, strValue);
    12.     return true;
    13.   }
    It can be that type equivalence is wrong in this case and IL2CPP version can't understande that 'value' is actually is int and can be checked by enum.
     
  26. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    Engineers can now, iboxDB modify and issued new plug-in, can run well in unity.
     
  27. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    When I was in unity4.6.1. Used in p3 AudioToolkit v6.5.3 errors:
    Serialization the depth limit exceeded the at 'AudioItem. There may be an object composition cycle in one or more of your serialized classes.

    Before this version is ok.
     
  28. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    Hi genius-fx,

    GameCenter not working is a bug that is fixed internally.
    link.xml not being picked up by the il2cpp codestripper is a bug that's fixed internally.

    could you file a bug for the reflection problem you're seeing?

    We'll take a look at the TryParse bug for the enum.

    We're working hard to get out a new build with all these fixes, hopefully in the next few days, we'll make sure that the build is posted in this thread as well. If you run into more issues, please let us know about 'm, and we'll get straight on 'm.

    Bye, Lucas
     
  29. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    So far in our testing, il2cpp builds have always been as fast or faster as mono builds. (except for a gc performance problem in the previous build, which will be fixed in the new one). If you have a project that runs slower, we would really love to take a look at it. if you could file a bug and attach the project that would be great.

    thanks, Lucas
     
  30. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    To save some time, disable the indexing process by going to a terminal and type
    defaults write com.apple.dt.XCode IDEIndexDisable 1

    On your next build it should only do Indexing Text process. The Index | Processing Files will be skipped.
     
  31. Wiliz

    Wiliz

    Joined:
    Feb 18, 2014
    Posts:
    20
    I'm not seeing any difference in loading times between Mono and IL2CPP. Also CPU usage is slightly lower with IL2CPP and FPS higher in CPU-limited scenarios. Are you sure you've set Xcode to build with the Release configuration?
     
  32. hamstar

    hamstar

    Joined:
    Sep 25, 2013
    Posts:
    84
    My project has errors which might be due the same bug reported by ArjunN. Seems like a problem with serialization. The project is too large to submit for a bug report, but if you need any more details let me know.

    Code (CSharp):
    1. Exception loading data: System.Runtime.Serialization.SerializationException: Could not find type 'System.Collections.Generic.List`1[[LevelInfo, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
    2.   at LevelLoader.Start () [0x00000] in <filename unknown>:0
    3.   at LevelLoader.Start () [0x00000] in <filename unknown>:0
    4. UnityEngine.Debug:Internal_Log(Int32, String, Object)
    5. UnityEngine.Debug:LogWarning(Object)
    6. LevelLoader:Start()
    7. LevelLoader:Start()
    8. (Filename: /Applications/buildAgent/work/d63dfc6385190b60/artifacts/iPhonePlayer-armv7-il2cppGenerated/UnityEngineDebug.cpp Line: 56)
    9.  
    10. NullReferenceException: A null value was found where an object instance was required.
    11.   at LevelLoader.Start () [0x00000] in <filename unknown>:0
    12. (Filename: currently not available on il2cpp Line: -1)
    Full device log.
     
  33. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @huiyu

    Our internal tests with marshaling of byte[] are working, so this crash might be a case that we have not tested yet. Can you reproduce this in a project that you can submit with a bug report? That will really help us track down the cause of the problem. If you cannot and the Unity project is too large to submit via a bug, you can submit the bug with only the Xcode project (which is usually smaller). In this case, the Xcode project might be enough for us to correct the problem. Thanks.
     
  34. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @invicticide

    In addition to the solution from @Frederic My, you can also look at IntPtr.Size in C# code, if that is easier.
     
  35. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @taecg

    Is this error specific to IL2CPP? In other words, does it happen with iOS/Mono as well? If possible, can you submit a bug or provide more detailed information about the error? This is not one that we have seen before, AFAIK.
     
  36. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @hamstar: the problem you are hitting is that il2cpp did not convert the type List<LevelInfo>, because it didn't find a hard reference to it in the code (as it is made by reflection). we're working on a solution that makes code like this work, but it's a big chunk of work, so is not going to be available in the super short term. In the mean time, you can work around the problem by introducing a reference to List<LevelInfo> somewhere in your code, so that il2cpp will realize it needs to convert it. something like:

    public List<LevelInfo> _myUnusedLevelInfoField = new List<LevelInfo>();
     
  37. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @hamstar

    It looks like this is a case where we need to work around some of the current AOT limitations for IL2CPP. Can you attempt to define static fields which use the missing types in a MonoBehaviour. Something like this might work:

    Code (CSharp):
    1. class AotTypes : MonoBehaviour
    2. {
    3.     public static Parse.PlatformHooks _unused1 = new Parse.PlatformHooks();
    4.     public static List<LevelInfo> _unused2 = new List<LevelInfo>();
    5.     public static List<TimeRecord> _unused3 = new List<TimeRecord>();
    6. }
     
  38. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    Build successful but crashes.
    Using Facebook SDK 6.1(https://developers.facebook.com/docs/unity/downloads) which works fine in MonoDevelop 2.x causes EXC_BAD_ACCESS with IL2CPP
    It seems to crash after trying to access some FBSettings property which is a scriptable object. The crash seems to be on properties such as frictionlessRequests, e.g.

    Code (CSharp):
    1. void AssemblyU002DCSharp_FBSettings_CustomAttributesCacheGenerator_frictionlessRequests(CustomAttributesCache* cache)
    2. {
    3.     cache->attributes = (Il2CppObject**)il2cpp_gc_alloc_fixed(sizeof(mscorlib_System_Object *) * cache->count, 0);
    4.     {
    5.         UnityEngine_UnityEngine_SerializeField * tmp;
    6.         tmp = (UnityEngine_UnityEngine_SerializeField *)il2cpp_codegen_object_new (&UnityEngine_UnityEngine_SerializeField_il2cpp_TypeInfo);
    7.         UnityEngine_UnityEngine_SerializeField_m__ctor(tmp);
    8.         cache->attributes[0] = (Il2CppObject*)tmp;
    9.     }
    10. }
     

    Attached Files:

  39. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    You could also archive your project in Xcode, then validate it against iTunes Connect. Right now if you validate/upload 32 bit archives, you get a lengthy warning. If your archive has 64 bit it should pass the validation... That would be the ultimate litmus test :-0
     
  40. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    I'm facing a similar issue to Dimitry when trying to do TripleDES encryption. It throws this error:
    I don't see any mention of a fix from unity or a bug report from him. Is this a known issue, or should I submit a new bug?

    Note that I tried adding all sorts of namespaces to link.xml, but if Lucas from Unity Tech is right, this file isn't being parsed by IL2CPP so it doesn't solve anything! Right?
     
  41. hamstar

    hamstar

    Joined:
    Sep 25, 2013
    Posts:
    84
    Thanks for the suggestion @ljmeijer and @JoshPeterson. Unfortunately that didn't seem to make any difference.

    Some more info:
    Both the classes causing errors are serialized structs. The data is being saved/loaded from byte files. For example, a LevelInfo.bytes file is stored in the Resources folder. The file is assigned in the LevelLoader script inspector as a TextAsset. In LevelLoader.Start, the text asset's bytes are deserialized using BinaryFormatter.
     
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @xenonmiii

    We had a few bugs related to the FB SDK that will be corrected in our next release. If you can wait for our next release (likely later this week), then it might be work trying again. If you can submit a bug with an example project, that will help as well. Then we can verify the problem is fixed internally.
     
  43. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @ArjunN

    You're correct about link.xml, I don't think it will work in this case. Can you submit a new bug then? I think that is the best option to get this resolved.
     
  44. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @hamstar

    I think it would be best if we can take a look at your project in this case. Since it is too big for the bug reporter, can you submit a bug, then we can attempt to obtain the project via some alternative means? We can discuss how to get the project to us offline then. Thanks.
     
  45. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @genius-fx I tried reproducing your Enum.IsDefined problem, but it works for me. could you file a bug with a project where this happens for you so we can take a closer look? thnx, Lucas
     
  46. hamstar

    hamstar

    Joined:
    Sep 25, 2013
    Posts:
    84
    @JoshPeterson

    I singled out some of the offending code and created an example project. Submitted bug report case 665162
     
  47. Frederic-My

    Frederic-My

    Joined:
    Sep 23, 2012
    Posts:
    27
    Do you know if that's specific to some recent versions of XCode? I'm on 6.0.1, I tried validating a Mono build, and I'm not getting any warning, just "validation successful".
     
  48. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    If you send the app archive to iTunes Connect it should respond with any errors or warnings. The "is not 64 bit" warning is just a warning at this point.
     
  49. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    generally in my project I see errors when deserializing stuff. Serializing seems to work however.

    This works:
    Code (CSharp):
    1.     public static string MySerialize(object serializableObject) {
    2.         MemoryStream memorystream = new MemoryStream();
    3.         BinaryFormatter binaryformatter = new BinaryFormatter();
    4.         binaryformatter.Serialize(memorystream, serializableObject);
    5.         string tmp = System.Convert.ToBase64String(memorystream.ToArray());
    6.         return tmp;
    7.     }
    This never (?) works:

    Code (CSharp):
    1. public static T MyDeserialize<T>(string serializedData) {
    2.         MemoryStream dataStream = new MemoryStream(System.Convert.FromBase64String(serializedData));
    3.        
    4.         BinaryFormatter binaryformatter = new BinaryFormatter();
    5. #warning THIS FUNCTION CAUSES ERROR ON IL2CPP!
    6.         T deserializedObject = (T)binaryformatter.Deserialize(dataStream);
    7.         return deserializedObject;
    8.     }
    I rely on serializing/deserializing like this a lot. I serialize a game engine object to a string so I can save it to PlayerPrefs as a string. Then I read that string back and deserialize it. It worked on mono, granted I used the MONO_REFLECTION_SERIALIZER env variable. http://answers.unity3d.com/questions/30930/why-did-my-binaryserialzer-stop-working.html?sort=oldest This means that yes, this kind of serialising did not work on iOS/mono unless you set that flag to yes. I guess this kind of functionality is not in il2cpp (yet). Does anyone know of a good workaround for this? I'd really like to clear this problem out of the way for now with any workaround, so I can test other parts of my iOS 64 bit app....
     
  50. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @Umai: I think that environment variable should have the same effect on il2cpp. could you try?