Search code examples
c#xcodeunit-testingunity-game-engineunity-networking

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?


Solution

  • 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/