Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

AndroidSdkVersionFull.TryParse(string, out AndroidSdkVersionFull)

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Parameters

Parameter Description
version The string representation of the Android SDK version to parse, for example 36 or 36.1.
parsed When this method returns, contains the parsed AndroidSdkVersionFull if parsing succeeded, or null otherwise.

Returns

void true if version was successfully parsed; otherwise, false.

Description

Tries to parse an Android SDK version from a string, for example 36 or 36.1.

This method doesn't support previews and extension SDKs, such as 37.2-beta1, 36-ext18 and returns false.

using UnityEngine;
using UnityEditor;

public class AndroidSdkVersionFullTryParseSample : MonoBehaviour { [MenuItem("Build/AndroidSdkVersionFull TryParse Sample")] public static void ParseAndroidSdkVersionFull() { if (AndroidSdkVersionFull.TryParse("36.1", out AndroidSdkVersionFull version)) PlayerSettings.Android.compileSdkVersion = version; } }