Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.4
2018.4
2018.4.1f1
2019.1
2019.2
2019.3
Issue ID
1161733
Regression
No
[Android] UnityEditor.Android.AndroidDevice.Properties is unable to handle invalid values resulting in FormatException
To reproduce:
1. Make sure you have Android SDK Platform tools version of 29.0.0 (replace C:\Users\<user>\AppData\Local\Android\Sdk\platform-tools with attached platform tools package)
2. Open attached project "TestQuest.zip"
3. In Unity, Project window, TestEditor.cs script, line 23, change "deviceId" value to your connected mobile device's serial number
4. Build and Run on Android (Building works as intended)
Expected: application is built to a device of your choice
Actual: editor throws errors "FormatException: Input string was not in a correct format." due to UnityEditor.Android.AndroidDevice.Properties not handling invalid values
Reproduced in: 2017.4.30f1, 2018.4.4f1, 2019.1.10f1, 2019.2.0b9, 2019.3.0a9
Reproduced with Android SDK Platform tools: 29.0.0
Not reproduced with Android SDK Platform tools: 29.0.1
Note: full error:
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 <7d97106330684add86d080ecf65bfe69>:0)
System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <7d97106330684add86d080ecf65bfe69>:0)
System.Int32.Parse (System.String s, System.IFormatProvider provider) (at <7d97106330684add86d080ecf65bfe69>:0)
System.Convert.ToInt32 (System.String value) (at <7d97106330684add86d080ecf65bfe69>:0)
UnityEditor.Android.AndroidDeviceInfo.get_SDKVersion () (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.AndroidDeviceInfo.HasSDKSupport (System.Int32 minimumVersion) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+AndroidDeploymentTargetInfo.CheckTargetInternal (UnityEditor.Android.AndroidDeploymentTargetRequirements targetRequirements) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.AndroidDeploymentTargetsExtension+AndroidDeploymentTargetInfo.CheckTarget (UnityEditor.DeploymentTargetRequirements targetRequirements) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.GetTargetDevices (UnityEditor.Android.ADB adb) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <1a10f9035b6b403994c99e5b653643c6>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (UnityEditor.BuildOptions options, UnityEditor.BuildTarget target) (at <1a10f9035b6b403994c99e5b653643c6>: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)
Comments (2)
-
joebain
Aug 12, 2021 16:53
I am having this error with unity 2020.3.0f1 and I upgraded the sdk tools to 31.0.3 and the error is still present.
-
Boxies
Oct 17, 2019 23:22
This is thrown using the "recommended" android SDK tools installed with unity 2019.1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
Seems to be an Android SDK issue which is fixed by upgrading the Platforms tools to 29.0.1