Skip to content

Commit a2b827e

Browse files
<ValidateJavaVersion/> should be able to parse -rc4 in build-tools version
1 parent a121597 commit a2b827e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/Legacy/ValidateJavaVersion.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ Version GetJavaVersionForFramework ()
5858

5959
Version GetJavaVersionForBuildTools ()
6060
{
61+
string buildToolsVersionString = AndroidSdkBuildToolsVersion;
62+
if (buildToolsVersionString != null) {
63+
int index = buildToolsVersionString.IndexOf ('-');
64+
if (index != -1)
65+
buildToolsVersionString = buildToolsVersionString.Substring (0, index);
66+
}
6167
Version buildTools;
62-
if (!Version.TryParse (AndroidSdkBuildToolsVersion, out buildTools)) {
68+
if (!Version.TryParse (buildToolsVersionString, out buildTools)) {
6369
return Version.Parse (LatestSupportedJavaVersion);
6470
}
6571
if (buildTools >= new Version (24, 0, 1))

0 commit comments

Comments
 (0)