Search Unity

Cannot compile empty project with IL2CPP for Android on 2020.1.17f1

Discussion in 'Editor & General Support' started by ballistic_cowboy, Dec 11, 2020.

  1. ballistic_cowboy

    ballistic_cowboy

    Joined:
    Jun 30, 2018
    Posts:
    19
    I have submitted a bug report, but I thought I would check if anyone else has run across this issue? I can build fine with Mono backend, but IL2CPP seems to be completely broken (it worked fine in the 2019 LTS version when I last used it). I tried compiling for Arm 7 and 64, and as the title suggests with a completely empty project.

    The error that appears is a Win32Exception when the build process begins compiling the binary with the "Native error= mono-io-layer-error (5)" Does anyone have any ideas what's going on?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,697
    Interesting! I'm no expert here but perhaps it is what is known as a "Native error= mono-io-layer-error (5)" ??

    In all seriousness, I wonder if this is one of the Android build tools getting wedged. I've sometimes had success with the tried-and-true reboot Windows approach.

    Otherwise though, thanks for reporting the bug. Unity is good at chasing these sorts of things down.
     
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Can you provide the full error message from the editor log here?
     
  4. ballistic_cowboy

    ballistic_cowboy

    Joined:
    Jun 30, 2018
    Posts:
    19
    Of course! The full error is:

    Code (CSharp):
    1.  
    2. Win32Exception: ApplicationName='/opt/Unity/Editor/Data/il2cpp/build/deploy/netcoreapp3.0/il2cpp', CommandLine='--convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARMv7" --configuration="Release" --outputpath="/home/UnityHome/Games/TestIL2CPP/TestIL2CPP/Temp/StagingArea/assets/bin/Data/Native/armeabi-v7a/libil2cpp.so" --cachedirectory="/home/UnityHome/Games/TestIL2CPP/TestIL2CPP/Assets/../Library/il2cpp_android_armeabi-v7a/il2cpp_cache" --additional-include-directories="/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/bdwgc/include" --additional-include-directories="/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/libil2cpp/include" --baselib-directory="/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/Variations/il2cpp/Release/StaticLibs/armeabi-v7a" --avoid-dynamic-library-copy --tool-chain-path="/opt/Unity/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --incremental-g-c-time-slice=3 --profiler-report --map-file-parser="/opt/Unity/Editor/Data/Tools/MapFileParser/MapFileParser" --directory="/home/UnityHome/Games/TestIL2CPP/TestIL2CPP/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="/home/UnityHome/Games/TestIL2CPP/TestIL2CPP/Temp/StagingArea/Il2Cpp/il2cppOutput" ', CurrentDirectory='/home/UnityHome/Games/TestIL2CPP/TestIL2CPP/Temp/StagingArea/assets/bin/Data/Managed', Native error= mono-io-layer-error (5)
    3. System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <aa976c2104104b7ca9e1785715722c9d>:0)
    4. System.Diagnostics.Process.Start () (at <aa976c2104104b7ca9e1785715722c9d>:0)
    5. (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    6. UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at /home/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:46)
    7. UnityEditor.Utils.Program.Start () (at /home/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:30)
    8. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:124)
    9. UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:97)
    10. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:690)
    11. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (UnityEditor.Il2Cpp.Il2CppBuildPipelineData data, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:672)
    12. UnityEditorInternal.IL2CPPBuilder.Run () (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:505)
    13. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:228)
    14. UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3746c56c485a40cda2a56050de658f5e>:0)
    15. UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3746c56c485a40cda2a56050de658f5e>:0)
    16. 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 <3746c56c485a40cda2a56050de658f5e>:0)
    17. UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <3746c56c485a40cda2a56050de658f5e>:0)
    18. 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 /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:337)
    19. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /home/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
    20.  
     
    Last edited: Dec 15, 2020
  5. ballistic_cowboy

    ballistic_cowboy

    Joined:
    Jun 30, 2018
    Posts:
    19
    Thanks for the suggestion! Yes I have tried rebooting a few times, but to no avail - although I am using the Linux version of Unity, which maybe is a cause for this bug (I provided that information in my official bug report but forgot to mention it in my original post).
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    @ballistic_cowboy

    It looks like this is a bug related to Linux. IL2CPP should be running via .NET Core, but the error message suggests that the Unity Editor is using Mono to run it. Thanks for submitting the bug report, we will investigate this.
     
  7. ballistic_cowboy

    ballistic_cowboy

    Joined:
    Jun 30, 2018
    Posts:
    19
    Ah I see, that's good to know, thank you! In case it is useful for cross referencing purposes my bug report ID is 1298836.
     
  8. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    I'm encountering a similar issue on windows when trying to compile with il2cpp vs with mono. I'm trying to convert a audio file using an external exe (ffmpeg.exe) via a command line interface in a separate process. It looks like I'm getting a similar error with "Native error= mono-io-layer-error (0)".

    I find no difficulty launching the code from the main or a separate thread when using mono -- which I think should be expected as this code doesn't touch anything related to unity's API.

    My code works perfectly in editor and with builds when using mono, but with il2cpp I get an error:

    Error Message
    Code (CSharp):
    1.  
    2. WindowsPlayer(Obelisk) ApplicationName='C:/Users/colin/Desktop/Muse Slicer Build Release/Muse-Slicer_Data/Muse-Slicer_Data/StreamingAssets\ffmpeg\ffmpeg.exe', CommandLine='-nostdin -y -loglevel info  -i "G:/Media Library/Music/Adiemus/Adiemus IV_ The Eternal Knot/08 Connla`s Well.mp3"  -acodec pcm_f32le  -vn  "C:/Users/colin/AppData/LocalLow/Colin-Leet/Muse-Slicer\TempMusic\08 Connla`s Well.wav" ', CurrentDirectory='', Native error= mono-io-layer-error (0)
    3.   at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in <00000000000000000000000000000000>:0
    4.   at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) [0x00000] in <00000000000000000000000000000000>:0
    5.   at MediaToolkit.Engine.StartFFmpegProcess (MediaToolkit.EngineParameters engineParameters) [0x00000] in <00000000000000000000000000000000>:0
    6.   at MediaToolkit.Engine.FFmpegEngine (MediaToolkit.EngineParameters engineParameters) [0x00000] in <00000000000000000000000000000000>:0
    7.   at AudioLoading.FFMPEGHandling.ConvertToWAV (System.String mediaInFilePath, System.String mediaOutFilePath) [0x00000] in <00000000000000000000000000000000>:0
    8.   at AudioLoading.AudioLoadingManager+<FFMPEGConverstion>d__66.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
    9.   at CielaSpike.Task.MoveNextUnity () [0x00000] in <00000000000000000000000000000000>:0
    10.   at CielaSpike.Task.OnMoveNext () [0x00000] in <00000000000000000000000000000000>:0
    11.   at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0
    12.  
    Code Launching The External Application
    Code (CSharp):
    1. /// -------------------------------------------------------------------------------------------------
    2.         /// <summary>   Starts FFmpeg process. </summary>
    3.         /// <exception cref="InvalidOperationException">
    4.         ///     Thrown when the requested operation is
    5.         ///     invalid.
    6.         /// </exception>
    7.         /// <exception cref="Exception">
    8.         ///     Thrown when an exception error condition
    9.         ///     occurs.
    10.         /// </exception>
    11.         /// <param name="engineParameters"> The engine parameters. </param>
    12.         private void StartFFmpegProcess(EngineParameters engineParameters) {
    13.             // Verify that the process is not already running, if it is kill it.
    14.             if ( processRunning ) {
    15.                 EnsureFFmpegIsNotUsed();
    16.             }
    17.             processRunning = true;
    18.          
    19.             List<string> receivedMessagesLog = new List<string>();
    20.             TimeSpan totalMediaDuration = new TimeSpan();
    21.  
    22.             ProcessStartInfo processStartInfo = engineParameters.HasCustomArguments
    23.                                               ? this.GenerateStartInfo(engineParameters.CustomArguments)
    24.                                               : this.GenerateStartInfo(engineParameters);
    25.  
    26.             using ( this.FFmpegProcess = Process.Start(processStartInfo) ) {
    27.  
    28.                 Exception caughtException = null;
    29.  
    30.                 if ( this.FFmpegProcess == null ) {
    31.                     throw new InvalidOperationException(Resources.Exceptions_FFmpeg_Process_Not_Running);
    32.                 }
    33.  
    34.                 this.FFmpegProcess.ErrorDataReceived += (sender, received) => {
    35.                     if ( received.Data == null ) return;
    36. #if (DebugToConsole)
    37.                     Console.WriteLine(received.Data);
    38. #endif
    39.                     try {
    40.  
    41.                         receivedMessagesLog.Insert(0, received.Data);
    42.                         if ( engineParameters.InputFile != null ) {
    43.                             RegexEngine.TestVideo(received.Data, engineParameters);
    44.                             RegexEngine.TestAudio(received.Data, engineParameters);
    45.  
    46.                             Match matchDuration = RegexEngine.Index[RegexEngine.Find.Duration].Match(received.Data);
    47.                             if ( matchDuration.Success ) {
    48.                                 if ( engineParameters.InputFile.Metadata == null ) {
    49.                                     engineParameters.InputFile.Metadata = new Metadata();
    50.                                 }
    51.  
    52.                                 TimeSpan.TryParse(matchDuration.Groups[1].Value, out totalMediaDuration);
    53.                                 engineParameters.InputFile.Metadata.Duration = totalMediaDuration;
    54.                             }
    55.                         }
    56.                         ConversionCompleteEventArgs convertCompleteEvent;
    57.                         ConvertProgressEventArgs progressEvent;
    58.  
    59.                         if ( RegexEngine.IsProgressData(received.Data, out progressEvent) ) {
    60.                             progressEvent.TotalDuration = totalMediaDuration;
    61.                             this.OnProgressChanged(progressEvent);
    62.                         } else if ( RegexEngine.IsConvertCompleteData(received.Data, out convertCompleteEvent) ) {
    63.                             convertCompleteEvent.TotalDuration = totalMediaDuration;
    64.                             this.OnConversionComplete(convertCompleteEvent);
    65.                         }
    66.  
    67.                     } catch ( Exception ex ) {
    68.                         // catch the exception and kill the process since we're in a faulted state
    69.                         caughtException = ex;
    70.  
    71.                         try {
    72.                             this.FFmpegProcess.Kill();
    73.                         } catch ( InvalidOperationException ) {
    74.                             // swallow exceptions that are thrown when killing the process,
    75.                             // one possible candidate is the application ending naturally before we get a chance to kill it
    76.                         }
    77.                     }
    78.                 };
    79.  
    80.                 this.FFmpegProcess.BeginErrorReadLine();
    81.                 this.FFmpegProcess.WaitForExit();
    82.                 processRunning = false;
    83.  
    84.                 if ( ( this.FFmpegProcess.ExitCode != 0 && this.FFmpegProcess.ExitCode != 1 ) || caughtException != null ) {
    85.                     throw new Exception(
    86.                         this.FFmpegProcess.ExitCode + ": " + receivedMessagesLog[1] + receivedMessagesLog[0],
    87.                         caughtException);
    88.                 }
    89.             }
    90.         }
    91.     }
     
    Last edited: Jan 16, 2021
  9. loocid

    loocid

    Joined:
    Jul 4, 2014
    Posts:
    7
    @colinleet did you ever find a solution to your issue?
     
  10. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    TLDR version: No. I did find out for my bug --rather definitely-- that it's not user fixable, and won't be fixed any time soon, as it's been "delayed" for a few years now.

    I have time to read version: After making this post I did some additional research and I ended up finding this issue tracker -- which said that issue is a total inability to start any type of external process when using IL2CPP. The bug is highly upvoted (42 votes) and seems (seemingly indefinitely) postponed (post dates from 3 years ago -- Jul 2018):

    https://issuetracker.unity3d.com/is...process-dot-start-fails-to-launch-application

    It's Resolution Notice reads: "Postpone due to IL2CPP currently doesn't support external process creation.".
     
    Last edited: Jan 19, 2021
    JoRangers and loocid like this.
  11. loocid

    loocid

    Joined:
    Jul 4, 2014
    Posts:
    7
    I found out about this as well eventually after my previous post. Very unfortunate. Thanks for taking the time to reply
     
  12. ArshakKroyan

    ArshakKroyan

    Joined:
    Mar 4, 2015
    Posts:
    32
    I also have the same issue on Unity 2020.3.8f1.
     
  13. ArshakKroyan

    ArshakKroyan

    Joined:
    Mar 4, 2015
    Posts:
    32
    I fixed the problem on my side (I don't know what was the core problem though).

    I opened SDK Manager (Tools > SDK Manager) from Android Studio and updated the following SDK tools and added some SDK platforms (images below).
    Hope this will help others as well.

    upload_2021-6-29_13-7-18.png

    upload_2021-6-29_13-7-37.png
     
    jonbenet likes this.
  14. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    Any solution for non-android platforms using il2cpp?
     
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Can you provide details about the problem you see?
     
  16. colinleet

    colinleet

    Joined:
    Nov 20, 2019
    Posts:
    189
    See my first post in this thread for details on my problem. Basically I was wondering if there was any fix for being able to launch external executables from code complicated with il2cpp instead of mono? I was surprised that someone was able to overcome this error/unsupported feature by adding on a few extra Android SDK libraries. But as the final step in building desktop standalone applications is done entirely within Unity (instead of say an Android or iOS compiler) I have absolutely no idea as to if a similar fix might be possible for my (possibly unrelated but almost identical error messaging "Native error= mono-io-layer-error (5)") error in desktop il2cpp land.

    I can also make an example project if it would help, but I would be surprised if it could given this ticket's resolution notice:

    "Postpone due to IL2CPP currently doesn't support external process creation."
    https://issuetracker.unity3d.com/is...process-dot-start-fails-to-launch-application
     
  17. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Oh sorry, I missed your earlier post. I think there are at least two different issues being discussed in this thread.

    Your original issue, about using the .NET Process API to launch a process boils down to the fact that IL2CPP does not support this API, and we don't have any plans to add support soon.

    So you have two options:

    1. Use the Mono scripting backend to build the player.
    2. Implement your own process creation code in a native library and call that library from managed code - then you can use the IL2CPP scripting backend.
     
  18. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    Just hit this error attempting to build a release (IL2CPP) build from the Linux editor. This is coming from a normal BuildPipeline.BuildPlayer() call because the building of the player tries to launch the Android SDK Manager tool.

    @JoshPeterson Is this a bug that will be fixed? I understand that launching processes at runtime from IL2CPP may not be supported, but this is entirely in the Editor (as the first poster mentioned).

    Full error:
    Code (CSharp):
    1. ##[error]Win32Exception: ApplicationName='/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager', CommandLine='--list', CurrentDirectory='/asg/clockwork_cache/CloningMain', Native error= mono-io-layer-error (5)
    2. Win32Exception: ApplicationName='/opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager', CommandLine='--list', CurrentDirectory='/asg/clockwork_cache/CloningMain', Native error= mono-io-layer-error (5)
    3.   at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <aa976c2104104b7ca9e1785715722c9d>:0
    4.   at System.Diagnostics.Process.Start () [0x0003a] in <aa976c2104104b7ca9e1785715722c9d>:0
    5.   at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    6.   at UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) [0x0006d] in /home/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:48
    7.   at UnityEditor.Utils.Program.Start () [0x00001] in /home/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:32
    8.   at UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00026] in <5cf84f2cc5134566935b135856517214>:0
    9.   at UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, Sys
    10. (process:594): Gdk-CRITICAL **: 19:32:00.523: gdk_display_beep: assertion 'GDK_IS_DISPLAY (display)' failed
    11. tem.Boolean updateCommand, System.String errorMsg, System.String toolsDir, System.String[] warningsToIgnore) [0x0007b] in <5cf84f2cc5134566935b135856517214>:0
    12.   at UnityEditor.Android.AndroidSDKTools.ListComponentsVersions () [0x00062] in <5cf84f2cc5134566935b135856517214>:0
    13.   at UnityEditor.Android.SDKManager.UpdatePackagesList () [0x00079] in <5cf84f2cc5134566935b135856517214>:0
    14.   at UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager+Component tool) [0x00001] in <5cf84f2cc5134566935b135856517214>:0
    15.   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKToolsDetector.GetVersion () [0x00006] in <5cf84f2cc5134566935b135856517214>:0
    16.   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) [0x0002b] in <5cf84f2cc5134566935b135856517214>:0
    17.   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) [0x00007] in <5cf84f2cc5134566935b135856517214>:0
    18.   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00177] in <5cf84f2cc5134566935b135856517214>:0
    19.   at UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00078] in <5cf84f2cc5134566935b135856517214>:0
    20.   at UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) [0x00084] in <5cf84f2cc5134566935b135856517214>:0
    21.   at UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) [0x00001] in <5cf84f2cc5134566935b135856517214>:0
    22.   at UnityEditor.PostprocessBuildPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target) [0x00015] in /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:146
    23. UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, String[], Boolean)
    24. UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, String[]) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:411)
    25. UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, String[]) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:310)
    26. UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions) (at /home/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline.bindings.cs:284)
    27. ClockworkEditor.ClockworkBuildPipeline:BuildRelease(BuildTarget, BuildTargetGroup, String) (at Assets/Editor/ClockworkBuildPipeline.cs:192)
    28. ClockworkEditor.ClockworkBuildPipeline:BuildReleaseQuest() (at Assets/Editor/ClockworkBuildPipeline.cs:93)
    29.  
    30.  
     
  19. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    Yes, I suspect that this issue can be corrected. This might be different from the original issue posted here though. In this case, does the file at /opt/unity/Editor/Data/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager actually exist?
     
  20. MaxTiganov-XD

    MaxTiganov-XD

    Joined:
    Sep 3, 2021
    Posts:
    1
    Fixed this error for android build by changing "Android SDK installed with unity" option to path to SDK installed with Android Studio
     
  21. zgl6yxnt

    zgl6yxnt

    Joined:
    Jul 7, 2021
    Posts:
    1
    Faced the same problem. The reason was that Unity was running under a different user, but Android SDK tools don't have required permissions.

    Code (JavaScript):
    1. ls -l Data/PlaybackEngines/AndroidPlayer/SDK/tools/bin/
    2. -rwxr--r-- 1 user user 6742 Sep 20 16:10 apkanalyzer
    3. -rwxr--r-- 1 user user 5253 Sep 20 16:10 archquery
    4. -rwxr--r-- 1 user user 6040 Sep 20 16:10 avdmanager
    5. -rwxr--r-- 1 user user 5250 Sep 20 16:10 jobb
    6. -rwxr--r-- 1 user user 6834 Sep 20 16:10 lint
    7. -rwxr--r-- 1 user user 3323 Sep 20 16:10 monkeyrunner
    8. -rwxr--r-- 1 user user 5613 Sep 20 16:10 screenshot2
    9. -rwxr--r-- 1 user user 6047 Sep 20 16:10 sdkmanager
    10. -rwxr--r-- 1 user user 3076 Sep 20 16:10 uiautomatorviewer
    11.  
    As you can see, sdkmanager has only permissions for run only under owner user. So quick fix is to set right permissions for that tools.
    I have not checked if it is enough to set permissions only for binaries in Data/PlaybackEngines/AndroidPlayer/SDK/tools/bin/, i executed the command `chmod -R 755 .` for whole Unity directory.
     
    EKG8g and fbigger like this.
  22. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    Yes, I believe that it was a permissions issue on that path for us as well.
     
  23. imapickle

    imapickle

    Joined:
    Jan 8, 2022
    Posts:
    1
    I got the same issue on MacBook - the issue was file permissions for me too - glad I found this :) Permissions were 764 for files in /Applications/Unity/Hub/Editor/2020.3.25f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin, looks like unity runs as a user not in the root group so can't execute them. The only change I made was to sudo chmod 775 * inside that dir and the build worked.
     
  24. AshyB

    AshyB

    Joined:
    Aug 9, 2012
    Posts:
    191
    This worked for me Linux mint 20.3 Unity Hub 3.0.1 Unity 2020.3.30f1
     
  25. loywong

    loywong

    Joined:
    Mar 15, 2016
    Posts:
    1
    Make a copy of the sdkmanager, and delete the old one. It worked on my mac.
     
  26. francesco-included

    francesco-included

    Joined:
    Oct 29, 2021
    Posts:
    11
    I got the same error when building for Android. I uninstalled that version of Unity from the Hub and reinstalled it plus all the modules and it worked.
     
  27. DMALPICASKY

    DMALPICASKY

    Joined:
    Jan 28, 2021
    Posts:
    1
    Hello everyone, thanks for all these great leads. I am working with school IT managed iMacs (unity deployed through JAMF, self-service) and got the following error:

    Am I correct in thinking that switching scripting backends from IL2CCP to Mono could fix the problem? AFAIK, the computers don't have .Net Core, and the android sdk manager paths may not have the appropriate permissions.
     
  28. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    I ran into this exact issue and it turned out to be a simple issue with OS permissions. I have multiple users on my Macbook and I had installed Unity version (2020.3.35f1) on one user account and then I was running into this issue trying to do builds on another user account. So I just had to run
    chmod -R g+x /Applications/Unity/2020.3.35f1/PlaybackEngines/AndroidPlayer

    to allow all system users to execute the necessary commands, like the sdkmanager, and since then it works.