Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Error building Player: FormatException: Input string was not in the correct format in Unity 2018

Discussion in 'Editor & General Support' started by Alonsospace, May 8, 2018.

  1. Alonsospace

    Alonsospace

    Joined:
    Oct 4, 2017
    Posts:
    3
    I just updated to Unity 2018.2.02b3 and when trying to build the apk I can't. This is the log but I can't understand it so I would appreciate if anyone could help me. I think it says something about using Parse with a string that it is not numbers but I haven't use Parse in this project so I-m quite lost. Thanks!

    Console Log:
    FormatException: Input string was not in the correct format
    System.Int32.Parse (System.String s) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629)
    System.Version..ctor (System.String version) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Version.cs:109)
    UnityEditor.Android.Utils.ParseVersion (System.String version)
    UnityEditor.Android.AndroidComponentProperties.get_PackageRevision ()
    UnityEditor.Android.AndroidComponentProperties.GetPackageRevision (System.String directory)
    UnityEditor.Android.AndroidSDKTools.BuildToolsVersion ()
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKBuildToolsDetector.GetVersion (UnityEditor.Android.AndroidSDKTools sdkTools, UnityEditor.Android.AndroidJavaTools javaTools)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (UnityEditor.Android.AndroidSDKTools sdkTools, UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (UnityEditor.Android.AndroidJavaTools javaTools, System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (UnityEditor.Android.AndroidJavaTools javaTools, Int32 minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (BuildOptions options, BuildTarget target)
    UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (BuildOptions options, BuildTarget target)
    UnityEditor.PostprocessBuildPlayer.PrepareForBuild (BuildOptions options, BuildTargetGroup targetGroup, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:106)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  2. Alonsospace

    Alonsospace

    Joined:
    Oct 4, 2017
    Posts:
    3
    The problem seems to be solved. What I did was going to android studio then file -> setting -> SDK Tools : uninstall version 28.0.0rcl and return to unity. Now Unity asked to install the newest SDK so I did and the build worked perfectly. Hope this can help
     
    infosekr likes this.
  3. lang_fox

    lang_fox

    Joined:
    May 19, 2014
    Posts:
    13
    Yes, let unity to update build-tools to 26.
    Build-tools at 28rc will throw this exception;
     
    infosekr and nola_dev like this.