简体   繁体   中英

Undeclared Identifier error Unity IOS to Xcode

I've a Unity 5.3.1 iOS project that also uses the new multiplayer network, UNet. Scary stuff. When I build and run the project, I get the following error in Xcode:

Use of undeclared identifier `IL2CPP_RAISE_MANAGED_EXCEPTION`

The project runs fine in the Unity Editor. It's in a huge Bulk_Generics_10.cpp script that deals with System.Comparison1<UnityEngine.Networking.NetworkSystem.PeerInfoPlayer

Here is the block of code that the error is found.

 // System.Void
 System.Linq.Enumerable/<CreateDistinctIterator>c__Iterator3`1<System.Object>::Reset()
 extern TypeInfo*
 NotSupportedException_t1382227673_0_il2cpp_TypeInfo_var; extern const
 uint32_t
 U3CCreateDistinctIteratorU3Ec__Iterator3_1_Reset_m_1278777949_0_MetadataUsageId;
 extern "C"  void
 U3CCreateDistinctIteratorU3Ec__Iterator3_1_Reset_m_1278777949_0_gshared
 (U3CCreateDistinctIteratorU3Ec__Iterator3_1_t1454147488_0 * __this,
 const MethodInfo* method) {    static bool s_Il2CppMethodIntialized;   if
 (!s_Il2CppMethodIntialized)    {       il2cpp_codegen_initialize_method
 (U3CCreateDistinctIteratorU3Ec__Iterator3_1_Reset_m_1278777949_0_MetadataUsageId);
        s_Il2CppMethodIntialized = true;    }   {
        NotSupportedException_t1382227673_0 * L_0 =
 (NotSupportedException_t1382227673_0 *)il2cpp_codegen_object_new
 (NotSupportedException_t1382227673_0_il2cpp_TypeInfo_var);
        NotSupportedException__ctor_m149930845_0(L_0, /*hidden
 argument*/NULL);       IL2CPP_RAISE_MANAGED_EXCEPTION(L_0);    } }

Looks like Unity did not hand it off cleanly to Xcode. I'm wondering if there's some adjustment I need to make in Unity.

How can I correct this error?

This is a new problem with the build packages for different platforms being optional in the installer. If you install a platform and then upgrade your version of Unity but don't install that platform on the second install the old version of the platform will remain and cause problems.

My solution was to totally wipe out my Unity3d folder and reinstall with the correct platforms.

related thread: http://forum.unity3d.com/threads/il2cpp_raise_managed_exception-undeclared-identifier.382377/

As far as I remember System.Linq is supported by iOS.

Here is a thread also exists regarding this,

Most of Linq extension methods from Linq for Collections are not working with IEnumerables on iOS since they require AOT runtime compiler which is not supported.

However there is a Linq for iOS library on Asset Store that is similar to Linq but doesn't require a runtime compiler. So you can use it on iOS.

Source: http://forum.unity3d.com/threads/linq-on-ios.84147/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM