Search Unity

4.6 iOS 64-bit beta

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

  1. invicticide

    invicticide

    Joined:
    Nov 15, 2009
    Posts:
    109
    So, I ran into a couple of weird things.

    First, I've implemented a simple Quake-style debug console, and in its Awake it iterates over all the methods of all the types in the assembly searching for a specific method attribute, which identifies that method as a command available to the console:

    Code (CSharp):
    1. Type[] types = Assembly.GetExecutingAssembly().GetTypes();
    2. foreach(Type type in types)
    3. {
    4.     MethodInfo[] methods = type.GetMethods(BindingFlags.Static | BindingFlags.NonPublic);
    5.     foreach(MethodInfo method in methods)
    6.     {
    7.         System.Object[] attributes = method.GetCustomAttributes(typeof(ConsoleCommand), true);
    8.         // Bind the command
    This works great under mono, but under IL2CPP I get an exception inside the GetCustomAttributes call:

    I have two guesses: either the ConsoleCommand attribute type is being stripped and we're not actually catching that until further down that call stack (as above), or there's something else wrong and it lives inside the black box of generated mono code where I can't (?) do anything about it. Any thoughts on this one?

    Second, when the above exception occurs, that MonoBehaviour never receives any Update calls. Under mono, if I got an exception in Awake, that would not preclude later Updates, but under IL2CPP it appears to be doing so. Is that expected behavior?[/code]
     
  2. Umai

    Umai

    Joined:
    Jun 18, 2013
    Posts:
    74
    Already tried, it does not work. This app is fully working on 32bit(mono).
     
  3. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    I tried running the Universal build with IL2CPP on an iPod touch 5g. The Unity settings is set for Architecture is set to Universal. Target iOS version is 6.0. On XCode, the Architectures was armv7, arm64. When it tries to run it, XCode gives the following error:

    "App installation failed
    This application does not support this device's CPU type."

    Any suggestions?
    (Note that the build runs (although crashes) on an iPhone6+)
     
  4. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    Weird bug?!
    Code (CSharp):
    1.             byte[] spe = new byte[4] { 137, 80, 78, 71 };
    2.             Array.Reverse(spe, 0, 4);
    3.  
    The above code crashes with that specific array contents. Very Weird. An array with all zero's seems to be ok.
     
  5. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    We are also experience PlatformInvoke crashes:
    Code (CSharp):
    1. il2cpp::vm::PlatformInvoke::MarshalDelegate(Il2CppDelegate*) at PlatformInvoke.cpp:230
     
  6. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @FrenzooInfo strange, I will take a look
    @Umai & @hamistar: thanks to the repro from hamistar i've found the problem, and am working on a fix.
    @invicticide: that sure sounds like a bug, we would love to have a repro case for it so we can fix it. The exception one I'm not so sure about yet. If you throw in Awake() yourself, and get different behaviour in mono than il2cpp, we'd also love to have a repro for that so we can fix it.

    thanks for all the reports everyone, we're working hard to get a new build out to you guys asap.
     
  7. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    A bit more on the Marshalling crash:
    Code (CSharp):
    1.         [MonoPInvokeCallback(typeof(FillInputBufferCallback))]
    2.         static bool FillInputBufferCallback(IntPtr internalBuffer, int bytesToFill, IntPtr objectHandle, out int bytesAvailable, out bool hasMoreInput)
    3.         {
    4.         }
    5.         [MonoPInvokeCallback(typeof(OutputBufferReadyCallback))]
    6.         static bool OutputBufferReadyCallback(IntPtr internalBuffer, int bytesAvailable, IntPtr objectHandle)
    7.         {
    8.         }
    9.  
    10. /// native code wrapper
    11. public delegate bool FillInputBufferCallback(IntPtr publicBuffer, int bytesToFill, IntPtr objectHandle, out int bytesAvailable, out bool hasMoreInput);
    12.  
    13. #if USE_IPHONE_CALLING_CONVENTION
    14.         private const string DllName = "__Internal";
    15. #else
    16.         private const string DllName = "TinyInflater";
    17. #endif
    18.         [DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
    19.         public extern static IntPtr tinfl_decompress_callback_to_callback_state_create(FillInputBufferCallback fillBufferPointer, int in_size, OutputBufferReadyCallback outReadyPointer, int out_size, IntPtr object_handle, bool rawStream, LogCallback logCallback);
    20.  
    21.  
    calling tinfl_decompress..... will crash with null in the MarshalDelegate code previously reported.
     
  8. anoncherry

    anoncherry

    Joined:
    Apr 26, 2014
    Posts:
    5
    Hi guys.
    I just installed version 4.6.1p3 assuming it supports 64 bit build. I installed this version in mac osx without removing my previous version 4.6.1f1. While building my project, unity keeps throwing error

    Error building Player: IOException: Failed to Copy File / Directory from '/Applications/Unity/Unity.app/Contents/PlaybackEngines/iOSSupport/Trampoline/Libraries/libiPhone-lib-i386-il2cpp.a' to '/Path/To/iOSProject/Libraries/libiPhone-lib.a'.

    I browsed the directory to locate the file 'libiPhone-lib-i386-il2cpp.a', and it was not present there.

    Please help!!!
     
    Last edited: Jan 21, 2015
  9. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    Deeper Digging into the Marshalling crash:

    Coincidently we also had another function that was similar except that it doesn't return anything :

    public delegate void Fillbuffer...
    instead of
    public delegate bool Fillbuffer....

    The delegate with void return marshalled ok.. No crashes
     
  10. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    More Bugs:

    System.Threading.Interlocked.CompareExchange also crashes with EXC_BAD_ACCESS
     
  11. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    Btw, it works when compiling using .net 2.0 subset (smcs compiler). The gmcs compiler never did work for us due to a whole bunch of AOT problems.
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @hamstar
    Thanks for the bug report, we are investigating it.
     
  13. ArjunN

    ArjunN

    Joined:
    Jan 18, 2013
    Posts:
    21
    @josh, I have submitted a new bug on this (Case 665375).

    Thanks,
    Arjun
     
  14. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    My project relies on reflection a lot, and for various reasons I can't just declare unused fields of required types to avoid them being stripped. Would there be some way of forcing IL2CPP to generate code for some types no matter what? link.xml seems like an obvious place for this kind of blacklisting.
     
    Last edited: Jan 21, 2015
  15. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    IL2CPP generates incorrect code for obfuscated assemblies that have multiple members with the same name (on the IL-level). As a result, build fails in XCode:
    upload_2015-1-21_17-35-16.png

    Not sure if this can be classified as a bug, but Mono AOT compiler has no problems with the same assembly.
     
  16. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @ZinM: you could also somewhere in your code create an instance of the type in question. we have a big change in the works that will drastically reduce the amount of types il2cpp needs to be able to statically find.

    @ZinM: I believe the ECMA spec for IL actually does not allow that kind of IL. I suspect it will work if you make a non development build, as we then use a different (shorter) naming scheme for fieldnames. We'll take a look if we can be more flexible on illegal IL for this case.

    Bye, Lucas
     
  17. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    That's the whole point - I can't do that as well, as I am using some types using Reflection only. There isn't a single direct reference to the type from the code at all, so it's understandable why stripper removes them. An option of forcing certain types to be included in the build would solve this problem.

    Thanks!
     
  18. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @ZimM: in the next drop you can have a link.xml in your assetsfolder to instruct the stripper to not strip certain things. however, also in that case you need to know which types those are. if you know which ones they are, you could today make a method somewhere that creates an instance of all of them.

    Bye, Lucas
     
  19. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    ,,,,,,,,,,,,,,,,,,,,,,

    The Unity 5.0.0b20 generated iOS project, go to "Build Settings", The "Apple LLVM 6.0 - Language - C++" , "C++ Standard Library" by default is "libc++".

    We have some customers ask for "C++ Standard Library" to be "libstdc++". If so, we'll get lots of linker error like following, I guess it is because libiPhone-lib-il2cpp-dev.a is build with "libc++" instead of "libstdc++" option. Do we have plan to support "libstdc++"?

    Also tried Unity version 4.5.2f1, its generated iOS project by default is "libstdc++" and it only support "libstdc++". "libc++" will get linker errors. Of course 4.5.2f1 does not have IL2CPP.


    Undefined symbols for architecture armv7:

    "std::__1::__shared_weak_count::~__shared_weak_count()", referenced from:

    std::__1::shared_ptr<Pfx::Asm::UnpackedData> std::__1::shared_ptr<Pfx::Asm::UnpackedData>::allocate_shared<Alg::UserAllocator<Pfx::Asm::UnpackedData>, Pfx::Asm::Assembly&>(Alg::UserAllocator<Pfx::Asm::UnpackedData> const&, Pfx::Asm::Assembly&&&) in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    std::__1::__shared_ptr_emplace<Pfx::Asm::UnpackedData, Alg::UserAllocator<Pfx::Asm::UnpackedData> >::~__shared_ptr_emplace() in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    std::__1::__shared_ptr_emplace<Pfx::Asm::UnpackedData, Alg::UserAllocator<Pfx::Asm::UnpackedData> >::~__shared_ptr_emplace() in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    "std::__1::__shared_weak_count::__release_shared()", referenced from:

    Pfx::Asm::DecodedAssemblies::~DecodedAssemblies() in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    Pfx::Asm::DecodedAssemblies::pushAssembly(Pfx::Asm::Context&, char const*, unsigned long, unsigned int) in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    Pfx::Asm::DecodedCGraph::DecodedCGraph(Pfx::Asm::Context&, std::__1::shared_ptr<Pfx::Asm::UnpackedData>&, unsigned int, unsigned char const*) in libiPhone-lib-il2cpp-dev.a(asmdecodedassemblies.o)

    Pfx::Linker::Detail::HandleImpl::backEnd(std::__1::vector<unsigned char, Alg::UserAllocator<unsigned char> >&, std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in libiPhone-lib-il2cpp-dev.a(linkerdetailhandleimpl.o)

    "std::__1::locale::has_facet(std::__1::locale::id&) const", referenced from:

    std::__1::basic_filebuf<char, std::__1::char_traits<char> >::basic_filebuf() in libiPhone-lib-il2cpp-dev.a(pfxcookerapilinkerhandle.o)
     
  20. drawcode

    drawcode

    Joined:
    Jul 21, 2008
    Posts:
    72
    Just ran our first test in the beta with ready to ship Mono builds in this beta 64 bit version under IL2CPP.

    IL2CPP
    Stripping on to Byte Code Level
    Fast but no Exceptions

    In this 64-bit beta version we are currently getting linking errors on Generic usage in LitJson based json code and some on UnityEngine.Networking.

    Not a ton of time to research right now trying to ship non 64 by Feb. Seems like the deep copy issue but not sure about Networking.

    Hopefully the new beta hurdles right over this issue because it is getting hot in here.

    XCode Link Errors

    "_AssemblyU002DCSharp_Engine_Data_Json_JsonMapper_m_ToObject_AssemblyU002DCSharp_GameLevel_mgp0_mscorlib_System_String_MethodInfo", referenced from:

    AssemblyU002DCSharp_GameLevels_RGCTXData in Bulk_Assembly-CSharp_1.o

    AssemblyU002DCSharp_AssemblyU002DCSharp_BaseGameLevels_1_AssemblyU002DCSharp_GameLevel_git_RGCTXData in Bulk_Generics_8.o

    AssemblyU002DCSharp_AssemblyU002DCSharp_DataObjects_1_AssemblyU002DCSharp_GameLevel_git_RGCTXData in Bulk_Generics_8.o

    "Register_UnityEngine_NetworkView_INTERNAL_CALL_Internal_SetViewID()", referenced from:

    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o

    "Register_UnityEngine_MasterServer_set_dedicatedServer()", referenced from:

    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o

    "Register_UnityEngine_NetworkView_Internal_GetViewID()", referenced from:

    RegisterAllStrippedInternalCalls() in UnityICallRegistration.o
     
    Last edited: Jan 22, 2015
  21. eddie312

    eddie312

    Joined:
    Sep 13, 2012
    Posts:
    24
    Hi,
    I'm currently testing the IL2CPP build and it look like this asset is failing the build on IOS.

    Classes/Native/Bulk_Assembly-CSharp_0.cpp
    Classes/Native/Bulk_Assembly-CSharp_0.cpp:1086:6: Expected ';' after expression

    https://www.assetstore.unity3d.com/en/#!/content/12476 uni webview.
     
  22. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    eddie312, Try with stripping disabled.
     
  23. eddie312

    eddie312

    Joined:
    Sep 13, 2012
    Posts:
    24
    thanks but, stripping is already disabled.
     
  24. ArjunNair

    ArjunNair

    Joined:
    Dec 17, 2014
    Posts:
    1
    Not sure if this will help but did you try setting Build Active Architectures Only to "Yes" in Xcode? I remember this fixed that same error when I was trying to build for 64 bit.
     
  25. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    UnityEngine.Networking does not yet work in 4.6 IL2Cpp builds, this is a known issue.

    It should work in 5.0 il2cpp builds.
     
    drawcode likes this.
  26. xenonmiii

    xenonmiii

    Joined:
    Aug 2, 2010
    Posts:
    147
    @ArjunNair Thanks, that solved the issue to build and run on the non-64-bit device.
     
  27. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @FrenzooInfo can you reproduce that problem with Array.Reverse? I've tried here and it worked fine.
     
  28. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @Umai
    Thanks again for this bug report, it uncovered a few subtle issues. I've just made the final change today to correct the problems. I'll ping you via the bug report when they are available in a release. Unfortunately, we did not make the cut-off for the next 5.0 and 4.6 releases, but the fixes should be out soon.
     
  29. huiyu

    huiyu

    Joined:
    Jan 15, 2015
    Posts:
    19
    I can answer my own question after experiment both versions of Unity.

    Unity 4.6.1P3 can only link with libstdc++ library.
    Unity 5.0.0b20 can only link with libc++ library.

    This is one difference between 4.6.1P3 and 5.0.0b20.
     
  30. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    Yes, that's our design decision. 5.0 should move forward and use newer version of library (we are also now enabling ARC by default for all 5.0 projects). For 4.6 we chose to be backwards compatible with older 4.x revisions in that regard.
     
  31. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    I believe you are trying to compile for Simulator SDK with il2cpp scripting backend. Unfortunately this build lacks proper support for that. Next build will fix that. At the moment you should switch to Device SDK to try new scripting backend.
     
  32. anoncherry

    anoncherry

    Joined:
    Apr 26, 2014
    Posts:
    5
    Thanks mate, this solved the problem. As I am testing my game massively in simulator, is there any link or something that I can subscribe to when the fix is done?
     
  33. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    Yeps 100% reproducible.
    I've attached the project. I don't know if it makes a difference as I am using a pc to build first then transfering to an osx machine to compile witth xcode.
     

    Attached Files:

  34. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @FrenzooInfo: I've tried your project on our mainline development branch, and it works the same as it does in the Editor, so it looks like whatever problem you are hitting, has already been fixed. We're hard at work to push out another build.

    L
     
  35. FrenzooInfo

    FrenzooInfo

    Joined:
    May 2, 2014
    Posts:
    46
    Great, it sure is a weird one tho.. Any ETA on the next build?
     
  36. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    @FrenzooInfo: if QA thinks it is good to go, then might be as early as today, if not, it depends on how long it takes us to fix whatever problem they uncovered :)
     
  37. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @eddie312:
    Can you submit a bug and include the example project which causes this problem. It looks like IL2CPP is generating bad C++ code here. We definitely want to correct it. Thanks.
     
  38. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    @FrenzooInfo
    This crash in the marshaling code is rather odd. I can't say what it causing it now. Can you submit a bug with the project that causes the problem? I would really like to have a look, so I believe are internal tests do the same thing as your project. I suspect that we are missing a test case for a subtle difference here.

    Also, we can have a look at the System.Threading.Interlocked.CompareExchange crash as well. Thanks.
     
  39. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    So Patch5 for 4.6.1 is out, should we download this now as it contains the -> Support for iOS 64-bit builds using il2cpp. No separate build from you guys? just making sure everyone aware.
     
  40. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Yes. Everyone, update to 4.6.1p5 - it is the latest 4.6 iOS 64 build, and has the latest changes!
     
  41. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
    Is there a list of all fixes on IL2CPP ? :)
     
  42. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Here is an incomplete list of improvements and fixes in 4.6.1p5 related to IL2CPP. All of these fixes are in 4.6.1p5, but there are others which I have certainly missed. We're planning to do a better job of reporting specifically which fixes and improvements have made it to 4.6 in upcoming releases. Hopefully this list is better than nothing, and provides some useful information.

    Improvements:
    * Fix GC pauses when using IL2CPP scripting backend. Should be similar or better than pauses with Mono backend now.
    * Fix a few random crashes due to incorrect GC scanning

    Fixes:
    * Correct the assignment of an enum to a System.Enum field with IL2CPP. (663599)
    * Do not attempt to marshal a struct with a field which is an array of the same type as the struct. This can cause IL2CPP to have a stack overflow exception. (663490)
    * Write the method declaration includes for the element type in an array correctly. (648259)
    * Handle IntPtr and UIntPtr used an array indexes with IL2CPP in compact mode. (650807)
    * Handle pinned types in generic methods correctly with IL2CPP. (662979)
    * Correctly marshal null values for all nullable types to native code. (662167)
    * Fix memory leaks when Memory.wait() was timing out on IL2CPP backend. (662675)
    * Fix BinaryFormatter throwing NotSupportedException.
    * Fixed reflection APIs to be thread safe.
    * Fixed covariance support for value type arrays.
    * Fixed Thread.GetManagedThreadID.
     
  43. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
  44. Lucas-Meijer

    Lucas-Meijer

    Unity Technologies

    Joined:
    Nov 26, 2012
    Posts:
    175
    note: releasenotes make it sound like BinaryFormatter works, but it is not correctly functioning in this build. the remaining fixes for it just missed the cutoff, and will be in next one.
     
  45. Liszt

    Liszt

    Joined:
    Jan 12, 2015
    Posts:
    29
    With the new version there is an issue (that we didn't have with the old one).
    We use a custom builder (for a while now) and with your last revision 4.6.1p5 the python scripts seem rejected cause of this error :
    <WARNING>/usr/bin/python: can't find '__main__' module in '/Users/MyAcnt/Desktop/iphone/MyProject/Unity'

    I'll try with mono backend asap, but with IL2CPP it didn't work anymore.
     
  46. ZimM

    ZimM

    Joined:
    Dec 24, 2012
    Posts:
    963
    Is link.xml now taken into account in 4.6.1p5 release?
     
  47. RalphH

    RalphH

    Administrator

    Joined:
    Dec 22, 2011
    Posts:
    592
    @ZimM, yes it should be.
    @Liszt A bug report would help us identify one. Can you make a small replication of what you are trying to do ?
     
  48. FredDeschenes

    FredDeschenes

    Joined:
    Mar 15, 2013
    Posts:
    21
    It seems like it's trying to use it, but I can't get it to work (error message isn't helpful).
    Code (CSharp):
    1. UserBlackList: /Users/snowstorm/Desktop/MMOT/mmo-template-unity/Assets/link.xml
    2. Invoking UnusedByteCodeStripper2 with arguments: -out "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed" -l none -c link -x "/Applications/Unity_4.6.1p5/Unity_4.6.1p5.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity_4.6.1p5/Unity_4.6.1p5.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Assets/link.xml" -d "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed" -a  "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll"
    3. Failed running /Applications/Unity_4.6.1p5/Unity_4.6.1p5.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed" -l none -c link -x "/Applications/Unity_4.6.1p5/Unity_4.6.1p5.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity_4.6.1p5/Unity_4.6.1p5.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml" -x "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Assets/link.xml" -d "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed" -a  "/Users/snowstorm/Desktop/MMOT/mmo-template-unity/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll"
    4.  
    5. stdout;
    6. ERROR: Failed to resolve base type System.Configuration.ConfigurationException for type System.Configuration.ConfigurationErrorsException
    7. Fatal error in Mono CIL Linker
    8. System.Exception: ERROR: Failed to resolve base type System.Configuration.ConfigurationException for type System.Configuration.ConfigurationErrorsException
    9.   at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.IsMonoBehaviourOrScriptableObject (Mono.Cecil.TypeDefinition type) [0x00000] in <filename unknown>:0
    10.   at System.Linq.Enumerable+<CreateWhereIterator>c__Iterator35`1[Mono.Cecil.TypeDefinition].MoveNext () [0x00000] in <filename unknown>:0
    11.   at UnusedBytecodeStripper2.ResolveFromMonoBehaviours.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    12.   at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    13.   at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0
    14.   at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
    15.  
    Even turning off stripping doesn't help, I had to rename (or delete) link.xml to prevent this from happening.

    EDIT : Submitted 666131 for this.

    Also found another issue where Il2Cpp is telling me that a non-abstract class inside a Dll doesn't implement one of it's interface methods (when it obviously does, otherwise I wouldn't have been able to compile the Dll. It works with Mono compiler anyway). This was filed as 666129.
     
    Last edited: Jan 23, 2015
  49. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    It looks like the link.xml file may have System.Configuration.ConfigurationException in it, and you are targeting the unity profile (.Net Subset) in your player settings? In that case the error may be because the unity profile does not contain System.Configuration.ConfigurationException. Try targeting the .Net 2.0 profile instead.

    Does this work if you target Mono scripting backend?
     
  50. FredDeschenes

    FredDeschenes

    Joined:
    Mar 15, 2013
    Posts:
    21
    I do have
    Code (CSharp):
    1. <assembly fullname="System">
    2.     <namespace fullname="System.Net" preserve="all"/>
    3.     <namespace fullname="System.Net.Configuration" preserve="all"/>
    4.     <namespace fullname="System.ComponentModel" preserve="all"/>
    5.   </assembly>
    6.   <assembly fullname="System.Configuration">
    7.     <type fullname="System.Configuration.ExeConfigurationHost" preserve="all"/>
    8.   </assembly>
    in the link.xml file, but not ConfigurationException directly. This works fine with the Mono compiler. I am in fact targeting the .NET subset though. Thanks for the answer!