Skip to content

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Jun 29, 2020

Context: dotnet/android#4873

Although this is related to dotnet/android#4873, it is not the full fix. We probably should list the missing versions here anyway, though.

@jonpryor
Copy link
Contributor

For "sanity" purposes, I would prefer for starters that we not update KnownVersions, and instead try the patch suggested on dotnet/android#4873 (comment):

diff --git a/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs b/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs
index 1297e51..d2d3b5f 100644
--- a/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs
+++ b/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs
@@ -98,11 +98,15 @@ namespace Xamarin.Android.Tools
 
 		public string? TryGetPlatformDirectoryFromApiLevel (string idOrApiLevel, AndroidVersions versions)
 		{
+			string? dir = GetPlatformDirectoryFromId (idOrApiLevel);
+			if (Directory.Exists (dir))
+				return dir;
+
 			var id  = versions.GetIdFromApiLevel (idOrApiLevel);
 			if (id == null)
 				return null;
 
-			string? dir = GetPlatformDirectoryFromId (id);
+			dir = GetPlatformDirectoryFromId (id);
 
 			if (Directory.Exists (dir))
 				return dir;

and try to see how far we can get things to work w/o having KnownVersions data.

@jonathanpeppers
Copy link
Member Author

@jonpryor I think the problem happens even sooner:

https://github.com/xamarin/xamarin-android-tools/blob/3974fc38c0f25f943b5d3bf0a4e174532a2a60ee/src/Xamarin.Android.Tools.AndroidSdk/AndroidVersions.cs#L105-L119

If 29 came in here, these would both return null. And so null is passed into TryGetPlatformDirectoryFromApiLevel as well.

@jonathanpeppers
Copy link
Member Author

@jonpryor I can confirm that the actual problem here is fixed in: dotnet/maui-samples#25

This is using: dotnet/android@5d1ac0a

Should we merge this, or should I close it?

new AndroidVersion (28, "9.0", "Pie") {
AlternateIds = new[]{ "P" },
},
new AndroidVersion (29, "10.0", "Android X") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Android X" was the codeName for API-29?!

I don't remember that codename…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context: dotnet/android#4873

Although this is related to xamarin-android#4873, it is not the full fix. We probably should list the missing versions here anyway, though.
@jonpryor jonpryor merged commit 8e63795 into dotnet:master Jul 8, 2020
@jonathanpeppers jonathanpeppers deleted the api-29-30 branch July 8, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants