Skip to content

Instantly share code, notes, and snippets.

@dellis1972 dellis1972/change.diff Secret
Created Jul 6, 2017

Embed
What would you like to do?
diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
index a68196d..61d8dd9 100644
--- a/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tasks/ResolveSdksTask.cs
@@ -336,6 +336,12 @@ namespace Xamarin.Android.Tasks
if (UseLatestAndroidPlatformSdk) {
AndroidApiLevel = GetMaxInstalledApiLevel ().ToString ();
SupportedApiLevel = GetMaxSupportedApiLevel (AndroidApiLevel);
+ int maxInstalled, maxSupported = 0;
+ if (int.TryParse (AndroidApiLevel, out maxInstalled) && int.TryParse (SupportedApiLevel, out maxSupported) && maxInstalled > maxSupported) {
+ Log.LogDebugMessage ($"API Level {AndroidApiLevel} is greater than the maximum supported API level of {SupportedApiLevel}. " +
+ "Support for this API will be added in a future release.");
+ AndroidApiLevel = SupportedApiLevel;
+ }
TargetFrameworkVersion = GetTargetFrameworkVersionFromApiLevel ();
return TargetFrameworkVersion != null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.