- Home /
Export failed with Il2cpp on Android
I tried compiling with Il2cpp after my app was crashing unexpectely on my Android device without any apparently reasons on Mono2x(Before upgrading my device at 7.0 and upgrading unity at 5.5 everything was fine). Now the Il2cpp get me an error:
Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="D:\flappy-balls\FlappyBalls\Temp/StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="D:\flappy-balls\FlappyBalls\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/android-ndk-r10e" --extra-types.file="C:\Program Files\Unity\Editor\Data\il2cpp\il2cpp_default_extra_types.txt" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp-firstpass.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\Assembly-CSharp.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Advertisements.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.UI.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.Analytics.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\UnityEngine.dll" --assembly="D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Managed\mscorlib.dll" --generatedcppdir="D:\flappy-balls\FlappyBalls\Temp\StagingArea\Il2Cpp\il2cppOutput"
stdout: Building libil2cpp.so with AndroidToolChain. Output directory: D:\flappy-balls\FlappyBalls\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a Cache directory: D:\flappy-balls\FlappyBalls\Library\il2cpp_android_armeabi-v7a\il2cpp_cache ObjectFiles: 458 of which compiled: 458 Time Compile: 52588 milliseconds Il2CppAttributes.cpp Time Compile: 51593 milliseconds Bulk_mscorlib_6.cpp Time Compile: 46477 milliseconds Bulk_Generics_8.cpp Time Compile: 46472 milliseconds Bulk_mscorlib_1.cpp Time Compile: 37293 milliseconds Il2CppInvokerTable.cpp Time Compile: 28150 milliseconds Bulk_UnityEngine.UI_0.cpp Time Compile: 25710 milliseconds GenericMethods0.cpp Time Compile: 25202 milliseconds Bulk_mscorlib_7.cpp Time Compile: 24945 milliseconds Bulk_mscorlib_3.cpp Time Compile: 24574 milliseconds Bulk_UnityEngine_1.cpp Total compilation time: 148848 milliseconds. il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: @"C:\Users\Stefano\AppData\Local\Temp\tmpB6E6.tmp" -o "D:\flappy-balls\FlappyBalls\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_90ACCBBC1BA9BA0B735A25056579A3E9\libil2cpp.so" -Wl,-soname,libil2cpp.so -shared -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\android-ndk-r10e\platforms\android-9\arch-arm" -gcc-toolchain "C:\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -L "C:\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -fuse-ld=gold
in Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(IEnumerable`1 objectFiles, CppToolChainContext toolChainContext) in Unity.IL2CPP.Building.CppProgramBuilder.Build() in il2cpp.Program.DoRun(String[] args) in il2cpp.Program.Run(String[] args) in il2cpp.Program.Main(String[] args) stderr:
Eccezione non gestita: Unity.IL2CPP.Building.BuilderFailedException: @"C:\Users\Stefano\AppData\Local\Temp\tmpB6E6.tmp" -o "D:\flappy-balls\FlappyBalls\Library\il2cpp_android_armeabi-v7a\il2cpp_cache\linkresult_90ACCBBC1BA9BA0B735A25056579A3E9\libil2cpp.so" -Wl,-soname,libil2cpp.so -shared -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "C:\android-ndk-r10e\platforms\android-9\arch-arm" -gcc-toolchain "C:\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" -target armv7-none-linux-androideabi -L "C:\android-ndk-r10e\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a" -lgnustl_static -fuse-ld=gold
in Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(IEnumerable`1 objectFiles, CppToolChainContext toolChainContext) in Unity.IL2CPP.Building.CppProgramBuilder.Build() in il2cpp.Program.DoRun(String[] args) in il2cpp.Program.Run(String[] args) in il2cpp.Program.Main(String[] args)
UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:96) UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:281) UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:272) UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:126) UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:32) UnityEditor.HostView:OnGUI()
Which version of Unity are you using? There was a bug in some versions that prevented compiler errors from the Android toolchain from being displayed properly. It looks like you might be running into that issue. So it is difficult to tell what the real cause of this problem is.
I'm using unity 5.5.0f3. Unity 5.6 should resolve the issue?
Yes, the problem with incorrect compiler error output does not happen with Unity 5.6. So I believe that we should at least get a clearer indication about what the actual error message is. I doubt that Unity 5.6 will correct the problem itself though.
Thanks. Now it compiles just fine. But the problem with the crash on the phone occours also using Il2cpp. I should dig better in the errors that are showed in the Android monitor using Android studio and my phone attached via debug usb.
Your answer
Follow this Question
Related Questions
Switching from Mono to IL2CPP causes a couple of in-game objects not to show - only on device 1 Answer
How to do communication between apps. ( Android ) 2 Answers
IL2CPP support for Linq 1 Answer
Unity project on android - OnPointerDown/Up movement 1 Answer
How can I stick buttons on my cube and the same time using script? 1 Answer