unity 64-bit build error-Win32Exception il2cpp.exe did not run properly

Hi
I have been trying to build apk (or aab) for the last 3days to comply with the new Playstore 64-bit requirement but to no success, i have downloaded and used ndkr16b and other forms of solutions that were suggested from similar post like this but they don’t seems to work for me. i had used different versions of unity like unity 2.0, 2.6f1, 2.8f1,3.0f1beta. all to no avail. the below error message is from the 2.6f1 ver. what i could make out from it is that the operation need an elevation and i am using an admin user of my computer. with 2.8f1 and 3.0 beta it was show unitylinker.exe error.
Thank you in advance for your help.

Win32Exception: ApplicationName=‘C:\Program Files\Unity\Hub\Editor\2018.4.8f1\2019.2.6f1\Editor\Data\il2cpp/build/il2cpp.exe’, CommandLine='–convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile=“unityaot” --compile-cpp --libil2cpp-static --platform=“Android” --architecture=“ARMv7” --configuration=“Release” --outputpath=“C:\Users\rafafas\Desktop\On going project\unity Projects\master\master\rafafasavi\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so” --cachedirectory=“C:\Users\rafafas\Desktop\On going project\unity Projects\master\master\rafafasavi\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2018.4.8f1/2019.2.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include” --additional-include-directories=“C:/Program Files/Unity/Hub/Editor/2018.4.8f1/2019.2.6f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include” --tool-chain-path=“C:/Users/rafafas/Desktop/On going project/unity Projects/unitytest apks/android-ndk-r16b-windows-x86_64/android-ndk-r16b” --profiler-report --map-file-parser=“C:/Program Files/Unity/Hub/Editor/2018.4.8f1/2019.2.6f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe” --directory=“C:/Users/rafafas/Desktop/On going project/unity Projects/master/master/rafafasavi/Temp/StagingArea/assets/bin/Data/Managed” --generatedcppdir=“C:/Users/rafafas/Desktop/On going project/unity Projects/master/master/rafafasavi/Temp/StagingArea/Il2Cpp/il2cppOutput” ', CurrentDirectory=‘C:\Users\rafafas\Desktop\On going project\unity Projects\master\master\rafafasavi\Temp\StagingArea\assets\bin\Data\Managed’, Native error= The requested operation requires elevation.
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <9f8c4786222746238eb929db40bf8dd1>:0)
System.Diagnostics.Process.Start () (at <9f8c4786222746238eb929db40bf8dd1>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:44)
UnityEditor.Utils.Program.Start () (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:28)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:104)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List1[T] arguments, System.Action1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:503) UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.String inputDirectory, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:484) UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:334) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5557b445b4634c46b2ec8376c040bd34>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5557b445b4634c46b2ec8376c040bd34>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <5557b445b4634c46b2ec8376c040bd34>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5557b445b4634c46b2ec8376c040bd34>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I think this is the relevant part of the error message:

The requested operation requires elevation.

Something seems to be wrong with the permissions in the Unity installation. The Unity editor is trying to run the il2cpp.exe managed executable, but it fails since the user does not have the proper permissions. I’m not sure why this occurs though.

Thank you for the quick response. I also don’t know why it is requesting for operation elevation because i am using the admin user, I had also tried:

  1. Uninstalled and re installed unity,
  2. Removed my antivirus,
  3. Specifically set the Il2cpp.exe permission to run as administrator.
  4. Delete all cache from previous runs.
  5. Reimport the project in a new project.
    After all the above failed and giving similar errors as above.

I installed unity 2019.2.11f1 on a friend laptop (a faster one) and rerun the project again, unfortunately I got the same errors again. I also repeated steps 1-5 above but to no successful results. All these were done on a windows 10 OS.

Can you try this with an empty project? I doubt that it is related to the specific project, but that might be worth a try.

Thanks for the suggestion, I have tried to build 64Bit apk from empty project, yet it gave same error message. So I don’t think it’s a project specific problem too. However, 32 bit build is working with(out) empty project.

Does the 32-bit build work with the Mono scripting backend or the IL2CPP scripting backend?

It works very well with the mono scripting backend but not working with the il2cpp scripting backend.

Ok, the the issue if not 32-bit vs. 64-bit, but Mono vs. IL2CPP then. I’m not sure what is causing this issue - but I’ll see if others can help.

Can you undo step 3 (Specifically set the Il2cpp.exe permission to run as administrator.) - or maybe re-install Unity but don’t do that. A default installation should work.

I have undone step 3. And reran the project but it still show the il2cpp.exe error.
Here is what I did to build my 64bit and upload on playstore.
I exported the app to android studio using mono(since mono backend scripting is working fine on unity, even I cant export with il2cpp backend scripting), then I resolved the errors and specify the a big filter to run arm64-v8a along side armeabi-v7a which was already exported from unity. I ran and checked this. I uploaded on playstore and currently solved my problem temporarily. I would really love to be able to run my project on unity without having to export all the time.
Thanks for the suggestions. I am looking forward to this il2cpp issues being resolved ( it mostly stop at the point where loading bar is showing “building project with IL2CPP” or something like that.

I mean to say abifilters

I’m unsure why you see this error when starting il2cpp.exe. It does not normally happen, so there must be something still wrong with the Unity installation or permissions.

@JoshPeterson ,
Thanks for your responses.
I finally solved the issue of admin privilege required.
It has to do with the location of the ndk r16b folder.
As above I used

Problem: “C:/Users/rafafas/Desktop/On going project/unity Projects/unitytest apks/android-ndk-r16b-windows-x86_64/android-ndk-r16b”

Instead of:
Solution: “C:/android-ndk-r16b”

And that solved it.

1 Like

Thanks for the feedback on how you solved this issue. It will certainly help others.

So you for solved it change the position of folder “android-ndk-r16b”?

Yo tengo un error similar
Por si alguien me puede ayudar les agradecería
Win32Exception: ApplicationName=‘C:\Program Files\Unity\2019.2.20f1\Editor\Data\il2cpp\build/UnityLinker.exe’, CommandLine=‘-out=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed/tempStrip -x=“C:/Program Files/Unity/2019.2.20f1/Editor/Data/PlaybackEngines/AndroidPlayer/Whitelists/Core.xml” -x=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed/…/platform_native_link.xml -x=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed/TypesInScenes.xml -d=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed --dotnetruntime=il2cpp --dotnetprofile=unityaot --use-editor-options --include-directory=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed --rule-set=Conservative --editor-data-file=C:/prueba/Temp/StagingArea/assets/bin/Data/Managed/EditorToUnityLinkerData.json --disable-engine-module-support --enable-engine-module-stripping --engine-stripping-flag=EnableUnityConnect --engine-modules-asset-file=“C:/Program Files/Unity/2019.2.20f1/Editor/Data/PlaybackEngines/AndroidPlayer/Whitelists/…/modules.asset”’, CurrentDirectory=‘C:\prueba\Temp\StagingArea\assets\bin\Data\Managed’, Native error= La operaciolicitada requiere elevaci

System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at :0)
System.Diagnostics.Process.Start () (at :0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:44)
UnityEditor.Utils.Program.Start () (at C:/buildslave/unity/build/Editor/Mono/Utils/Program.cs:28)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:104)
UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:71) UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:222)
UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String[ ] assemblies, System.String[ ] searchDirs, System.String outputFolder, System.String workingDirectory, System.String& output, System.String& error, System.String linkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Collections.Generic.IEnumerable1[T] additionalBlacklist, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.ManagedStrippingLevel managedStrippingLevel, System.Boolean stripEngineCode, System.String editorToLinkerDataPath) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:158) UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (System.Collections.IEnumerable assemblies, System.String managedAssemblyFolderPath, System.String[ ] assembliesToStrip, System.String[ ] searchDirs, System.String monoLinkerPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:358) UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:246) UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:326) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:63)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <502f1b7df2d7430696af84c6f02852ed>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <502f1b7df2d7430696af84c6f02852ed>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <502f1b7df2d7430696af84c6f02852ed>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)