Can't Build Android APK
Unity refuses to even start building an apk, it just immediately errors out with these 4 errors:
FormatException: Input string was not in a correct format.
System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Int32.Parse (System.String s, System.IFormatProvider provider) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Convert.ToInt32 (System.String value) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
UnityEditor.Android.AndroidDeviceInfo.get_SDKVersion () (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.AndroidDeviceInfo.HasSDKSupport (System.Int32 minimumVersion) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+AndroidDeploymentTargetInfo.CheckTargetInternal (UnityEditor.Android.AndroidDeploymentTargetRequirements targetRequirements) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+AndroidDeploymentTargetInfo.CheckTarget (UnityEditor.DeploymentTargetRequirements targetRequirements) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.FindCompatibleDevices (UnityEditor.Android.AndroidDeploymentTargetRequirements targetRequirements, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, System.Collections.Generic.List`1[T] knownDevices, System.Collections.Generic.List`1[UnityEditor.Android.PostProcessor.Tasks.CheckDevice+DeviceInfo]& compatibleDevices) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.GetTargetDevices (UnityEditor.Android.ADB adb) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <4132c5c2cd7b45b09ef33302ae416489>:0)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:106)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Error building Player: FormatException: Input string was not in a correct format.
Build completed with a result of 'Failed'
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
I've tried several unity versions, several android sdk versions, and even tried just building a completely empty project, same error.
Answer by acondevillamar · Jun 11, 2019 at 06:58 AM
I've recently upgraded to version 2018.4 and I am now seeing this error as well when trying to build to a phone. I've tried re-downloading / re-installing the newest version and also updated the build tools to the latest SDK, but I'm still not having any luck.
Your answer
![](https://koobas.hobune.stream/wayback/20220612202851im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Graphic issues on Android device Unity 5.2 1 Answer
Android apk fail 1 Answer
Variable doesn't exist? 0 Answers
Building successive APK's on different machines wont install 0 Answers
keystore was tampered 0 Answers