Il2cpp.exe error

I’m getting this error when trying to build with il2cpp: “il2cpp.exe did not run properly!”

Alsgo getting an error related to google play(i have google play plugin for the android version):
"IL2CPP error for type ‘GooglePlayGames.Native.PInvoke.PInvokeUtilities/OutStringMethod’ in assembly ‘C:\Users\Public\Documents\Unity projects(projectName)\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll’
Additional information: Build a development build for more information. Exception has been thrown by the target of an invocation. "

I have the same issue. Did you solve this?

Which version of Unity are you using in this case? We have seen this error in a the past, but I believe that it is corrected in the latest version (4.6.3p3). If the error is still happening in that version, please let me know, and we will investigate it. Thanks.

I’m getting this same error, I’m on Unity 5.0.0f4

@TimB

Please try the 5.0.0p2 release, as I believe this issue is corrected. You can get the patch release here: http://unity3d.com/unity/qa/patch-releases

@JoshPeterson It looks like 5.0.0p2 fixed this error. However now I’m getting this in the console:

<RI.Hid> Failed to create device file:
1f A device attached to the system is not functioning.

It doesn’t look like it affects anything, just annoying. I don’t think I’m the only one either RI.Hid Failed to Create Device File - Unity Engine - Unity Discussions It’s an old thread, but it looks as if recent patches have started causing this more.

@TimB

If you would like to submit a bug on this most recent issue, we can try to track it down. It does look to be unrelated to IL2CPP though. Thanks.

@JoshPeterson
I’m getting this same error, I’m on Unity 4.6.3 p4
Because of some reason,I can’t upgrade to 5.0.0p2

When I build a version of the IOS,the mono.exe crash!

There is Error Log:
Failed running F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp/il2cpp.exe --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --extra-types.file=“F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp\il2cpp_default_extra_types.txt” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Ionic.Zip.Reduced.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\JsonFx.Json.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\ZEngineLib.dll” “E:\Unity4.6.3\SGame\Temp\il2cppOutput\il2cppOutput”
stdout;
stderr:

Error building Player: Exception: F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp/il2cpp.exe did not run properly!

Thanks.

@liuxingyu131

I’m not sure that this error is specifically related to this thread. However, can you provide more details? If you look in the Console window in the editor, or the Editor.log file, you should see another error or two. At least one of them will show a call stack from il2cpp.exe which might help us track down the cause of the this error.

Note that I doubt using 5.0.0p2 will change the behavior, as we use the same version of IL2CPP across all Unity versions. Thanks.

@JoshPeterson
Thanks for reply.

There is Editor.log Error.
UserBlackList: E:\Unity4.6.3\SGame\Assets\AstarPathfindingProject\link.xml
Invoking UnusedByteCodeStripper2 with arguments: -out “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed” -l none -c link -x “F:/Program Files (x86)/Unity4.6.3/Editor/Data/Tools\native_link.xml” -f “F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp\LinkerDescriptors” -x “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed..\platform_native_link.xml” -x “E:\Unity4.6.3\SGame/Temp/StagingArea/Data/methods_pointedto_by_uievents.xml” -x “E:\Unity4.6.3\SGame\Assets\AstarPathfindingProject\link.xml” -d “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Ionic.Zip.Reduced.dll” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\JsonFx.Json.dll” -a “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\ZEngineLib.dll”
Invoking il2cpp with arguments: --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --extra-types.file=“F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp\il2cpp_default_extra_types.txt” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Ionic.Zip.Reduced.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\JsonFx.Json.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\ZEngineLib.dll” “E:\Unity4.6.3\SGame\Temp\il2cppOutput\il2cppOutput”
Failed running F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp/il2cpp.exe --copy-level=None --enable-generic-sharing --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --extra-types.file=“F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp\il2cpp_default_extra_types.txt” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp-firstpass.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Ionic.Zip.Reduced.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\JsonFx.Json.dll” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\ZEngineLib.dll” “E:\Unity4.6.3\SGame\Temp\il2cppOutput\il2cppOutput”
stdout;
stderr:

UnityEngine.Debug:Internal_Log(Int32, String, Object)
UnityEngine.Debug:LogError(Object)
UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:66)
UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection1, String, String) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:418) UnityEditorInternal.IL2CPPBuilder:Run() (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:275) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action1, RuntimeClassRegistry) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\Il2Cpp\IL2CPPUtils.cs:211)
UnityEditor.iOS.PostProcessiPhonePlayer:PostProcess(iOSBuildPostprocessor, BuildTarget, String, String, String, String, String, String, String, BuildOptions, RuntimeClassRegistry)
UnityEditor.iOS.iOSBuildPostprocessor:PostProcess(BuildPostProcessArgs)
UnityEditor.PostprocessBuildPlayer:Postprocess(BuildTarget, String, String, String, Int32, Int32, String, String, BuildOptions, RuntimeClassRegistry) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline\PostprocessBuildPlayer.cs:338)
UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[ ], String, BuildTarget, BuildOptions, Boolean, UInt32&)
UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions, Boolean) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:801)
UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:614)
UnityEditor.BuildPlayerWindow:GUIBuildButtons(Boolean, Boolean, Boolean, BuildPlatform) (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1681)
UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1636)
UnityEditor.BuildPlayerWindow:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindow.cs:1191)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[ ], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[ ], CultureInfo) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.Reflection.MethodBase:Invoke(Object, Object[ ]) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView:Invoke(String, Object) (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:244)
UnityEditor.HostView:Invoke(String) (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:237)
UnityEditor.HostView:OnGUI() (at C:\buildslave\unity\build\Editor\Mono\GUI\DockArea.cs:129)

(Filename: /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)
Error building Player: Exception: F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp/il2cpp.exe did not run properly!

(Filename: Line: -1)
System memory in use before: 0.59 GB.
Unloading 2006 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
System memory in use after: 92.1 MB.
Unloading 30403 unused Assets to reduce memory usage. Loaded Objects now: 3015.
Total: 1030.164063 ms (FindLiveObjects: 1.986399 ms CreateObjectMapping: 2.904806 ms MarkObjects: 4.872508 ms DeleteObjects: 80.427917 ms)
System memory in use before: 90.2 MB.
Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
System memory in use after: 90.2 MB.
Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 3015.
Total: 5.974963 ms (FindLiveObjects: 0.283038 ms CreateObjectMapping: 0.151418 ms MarkObjects: 4.518343 ms DeleteObjects: 0.015765 ms)

  • starting compile Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll, for buildtarget 9
    System memory in use before: 94.2 MB.
    Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 94.3 MB.
    Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 3015.
    Total: 5.856908 ms (FindLiveObjects: 0.428223 ms CreateObjectMapping: 0.145551 ms MarkObjects: 4.363626 ms DeleteObjects: 0.014665 ms)

*** Cancelled ‘Build.Player.iOSSupport’ in 143 seconds

The mono crash log is
问题事件名称: APPCRASH
应用程序名: mono.exe
应用程序版本: 0.0.0.0
应用程序时间戳: 51fa56ab
故障模块名称: mono-2.0.dll
故障模块版本: 0.0.0.0
故障模块时间戳: 51fa56a9
异常代码: c0000005
异常偏移: 001790f7
OS 版本: 6.1.7601.2.1.0.256.1
区域设置 ID: 2052
其他信息 1: 0a9e
其他信息 2: 0a9e372d3b4ad19135b953a78882e789
其他信息 3: 0a9e
其他信息 4: 0a9e372d3b4ad19135b953a78882e789

@liuxingyu131

Thanks for providing this information. Unfortunately, I’m still not sure about the cause of the problem. Can you submit this project with a bug report so that we can look at it more closely? Thanks.

OK,Because of confidentiality agreements,I can’t provide a example.

@liuxingyu131

I understand. If you can reproduce the problem with a smaller example that you can submit, that will also be helpful. Thanks.

I’m sorry,with a smaller example can’t trigger this bug…so I submit only editor.log.

@liuxingyu131

Ok, thanks. We will see is we can track it down with the existing bug. Thanks for submitting it.

@JoshPeterson
I really need to make a IOS version,now I lock the error with this conslone command.
Can you help me avoid this question? I give you dll?

mono “F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp/il2cpp.exe” --copy-level=None --enable-unity-event-support --emit-null-checks --enable-array-bounds-check --extra-types.file=“F:\Program Files (x86)\Unity4.6.3\Editor\Data\il2cpp\il2cpp_default_extra_types.txt” “E:\Unity4.6.3\SGame\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll” “E:\Unity4.6.3\SGame\Temp\il2cppOutput\il2cppOutput”

@liuxingyu131

If you can submit the contents of the Temp\StagingArea\Data\Managed directory with a bug (and not violate your confidentiality agreements), that should allow us to track down the cause of this issue.

OK.please check.

same error in Unity 5.1.f1! please fix this bug!

@dousi96

I don’t believe that we have a bug report with a reproducible project that we can use to correct this issue. If you can submit one, we would really appreciate it!