Native error= mono-io-layer-error (5) on Android build after update from 2019.4.14f1 to 2020.3.21f

Hello. I’m seeing the above error following an update to the 2020.3.21f1 LTS version. Builds all worked fine prior to the update. When I installed the update, I had the hub install the required SDK and NDK - if I choose any other SKD/NDK over those, it tells me, not supported… Scripting back end is IL2CPP.

I’m now drawing a blank from forum searches and my own limited knowledge in this area… Anyone know the solution to this one? Thanks.

The full error is:

Win32Exception: ApplicationName=‘/Applications/Unity/Hub/Editor/2020.3.21f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager’, CommandLine=‘–list’, CurrentDirectory=‘/Users/robertoliver/Unity Projects/GUDRT/GUDRT’, Native error= mono-io-layer-error (5)
System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) (at <0463b2ef957545c0a51b42f372cd4fbb>:0)
System.Diagnostics.Process.Start () (at <0463b2ef957545c0a51b42f372cd4fbb>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.Utils.Program.Start (System.EventHandler exitCallback) (at /Users/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:48)
UnityEditor.Utils.Program.Start () (at /Users/bokken/buildslave/unity/build/Editor/Mono/Utils/Program.cs:32)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, System.Boolean updateCommand, System.String errorMsg, System.String toolsDir, System.String[ ] warningsToIgnore) (at :0)
UnityEditor.Android.AndroidSDKTools.ListComponentsVersions () (at :0)
UnityEditor.Android.SDKManager.UpdatePackagesList () (at :0)
UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager+Component tool) (at :0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKToolsDetector.GetVersion () (at :0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at :0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at :0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at :0)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target) (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:146)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:123)

Not sure what exactly solved this after 36 hours of trying. Ended up installing the latest Android Studio, and additionally installed all SDKs from last 6 Android versions, plus a number of the SDK tools. Then pointed Unity at this SDK installation.

Now getting the android.enableR8=false error, which I think is solvable…

Edit: Easily solved, in temp/gradleout is a file Gradle.properties, comment om the eneableR8 line. Just in case any one else ends up here…

1 Like

Thank you. I had this exact error with the same Unity Version. Setting the SDK to the Android Studio version and the JDK to my own worked.