android build error on 2020.2.0a10

Hi,
when I build on Android target I have this error:

Win32Exception: ApplicationName='C:\Program Files\Unity\Hub\Editor\2020.2.0a10\Editor\Data\il2cpp/build/deploy/netcoreapp3.0/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\giuseppei\OneDrive - Agic Technology srl\Documenti\Unity\MyGPViewer4.0\Temp\StagingArea\assets\bin\Data\Native\armeabi-v7a\libil2cpp.so" --cachedirectory="C:\Users\giuseppei\OneDrive - Agic Technology srl\Documenti\Unity\MyGPViewer4.0\Assets..\Library\il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2020.2.0a10/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2020.2.0a10/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --baselib-directory="C:/Program Files/Unity/Hub/Editor/2020.2.0a10/Editor/Data/PlaybackEngines/AndroidPlayer\Variations\il2cpp\Release\StaticLibs\armeabi-v7a" --avoid-dynamic-library-copy --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2020.2.0a10/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2020.2.0a10/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="C:/Users/giuseppei/OneDrive - Agic Technology srl/Documenti/Unity/MyGPViewer4.0/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="C:/Users/giuseppei/OneDrive - Agic Technology srl/Documenti/Unity/MyGPViewer4.0/Temp/StagingArea/Il2Cpp/il2cppOutput" ', CurrentDirectory='C:\Users\giuseppei\OneDrive - Agic Technology srl\Documenti\Unity\MyGPViewer4.0\Temp\StagingArea\assets\bin\Data\Managed', Native error= Per eseguire l'operazione richiesta è necessaria l'esecuzione con privilegi elevati.

System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <525dc68fbe6640f483d9939a51075a29>:0)
System.Diagnostics.Process.Start () (at <525dc68fbe6640f483d9939a51075a29>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Utils.Program.Start () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List
1[T] arguments, System.Action1[T] setupStartInfo, System.String workingDirectory) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.IL2CPPBuilder.Run () (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action
1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <599a88f0dc984e9a84071cb802b80734>:0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :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 :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :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 <599a88f0dc984e9a84071cb802b80734>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

I tried to run command with elevated privileges by cmd and I have 20 errors:

C:\Users\giuseppei\OneDrive - Agic Technology srl\Documenti\Unity\MyGPViewer4.0\Temp\StagingArea\Il2Cpp\il2cppOutput\Assembly-CSharp4.cpp:20736:71: error: token is not a valid binary operator in a preprocessor subexpression

if FORCE_PINVOKE_INTERNAL || FORCE_PINVOKE_LogitechLedEnginesWrapper _INTERNAL

Can you help me?
Thanks in advance

I had a similar problem on an older version of Unity, it has to do with spaces " " in the path names. I see yours contains "OneDrive - Agic Technology srl". Perhaps try moving the project to a folder that doesn't contain spaces?


I've solved: I had a problem on a DllImport on a class (whitespace to be removed")
Also I have to launch UnityHub with elevated privileges
Thanks

1 Like


Delete all scripts named Logitech. Your problem will be solved.