Search Unity

IL2CPP build: The requested operation requires elevation.

Discussion in 'Windows' started by NateReese77, Mar 28, 2020.

  1. NateReese77

    NateReese77

    Joined:
    Jun 14, 2017
    Posts:
    26
    Hello,

    I recently purchased a new PC and did a fresh install of Unity. I'm having trouble building projects now - specifically IL2CPP for Windows. I found a few posts on the forum, but none worked for me. I added the administrator rights to all users for il2cpp.exe and uninstalled / reinstalled Unity + Visual Studio Components. I also tried with multiple different projects and project locations.

    I'm currently using 2019.3.3 and I'm on Windows 10.

    Any help would be amazing! Thanks.


    Code (CSharp):
    1. Win32Exception: ApplicationName='C:\Program Files\Unity\Hub\Editor\2019.3.3f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe', CommandLine='--convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x86" --configuration="Release" --outputpath="C:\Users\nater\Desktop\Test Project 3\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="C:\Users\nater\Desktop\Test Project 3\Assets\..\Library/il2cpp_cache" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.3.3f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Users/nater/Desktop/Test Project 3/Temp/StagingArea/Data/Managed" --generatedcppdir="C:/Users/nater/Desktop/Test Project 3/Temp/StagingArea/Data/il2cppOutput" ', CurrentDirectory='C:\Users\nater\Desktop\Test Project 3\Temp\StagingArea\Data\Managed', Native error= The requested operation requires elevation.
    2.  
    3. System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    4. System.Diagnostics.Process.Start () (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    5. (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    6. UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    7. UnityEditor.Utils.Program.Start () (at <9a184ab867bb42c296d20ace04f48df3>:0)
    8. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    9. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    10. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    11. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    12. UnityEditorInternal.IL2CPPBuilder.Run () (at <9a184ab867bb42c296d20ace04f48df3>:0)
    13. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    14. DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    15. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    16. Rethrow as BuildFailedException: Exception of type 'UnityEditor.Build.BuildFailedException' was thrown.
    17. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    18. UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <9a184ab867bb42c296d20ace04f48df3>:0)
    19. 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 <9a184ab867bb42c296d20ace04f48df3>:0)
    20. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    21.  
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Hey,

    Did you try installing Unity from a non-admin account/context, mentioned in this thread? Also, you definitely want to remove administrator rights from IL2CPP.exe.

    The problem isn't IL2CPP.exe needs admin access (nothing in Unity's build process should require this), but rather the Editor (running from a non-admin context) cannot launch IL2CPP.exe because the program itself requires admin access.

    I suspect if you launch the Editor as an admin, you'll be able to build because you're now running in a fully admin context. Of course you don't want this, and so completely uninstall Unity (make sure all the files are removed) and then re-install.
     
    phil_unity445 likes this.
  3. NateReese77

    NateReese77

    Joined:
    Jun 14, 2017
    Posts:
    26
    I actually got this working by uninstalling and reinstalling Unity and Visual Studio and then removing the admin rights from IL2CPP as you stated. I was still on admin when I installed Unity, but that seemed to do the trick! Thanks for the help.