From 44deb29b7fa8d425f0626f43648ddee61b5a94ff Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Wed, 4 Oct 2023 19:51:32 -0400 Subject: [PATCH] fix(androidsdk): only download arch independent or matching the host archives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoid downloading multiple files (one per arch) where the last one will be decompressed over the previous. E.g. ending up having `emulator` as a `arm64` binary on an `x86` Mac. Previous verbose logs showed: ``` ... – Downloading https://dl.google.com/android/repository/emulator-darwin_x64-10696886.zip ... – Downloading https://dl.google.com/android/repository/emulator-darwin_aarch64-10696886.zip ... ``` --- UnoCheck/Checkups/AndroidSdkCheckup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnoCheck/Checkups/AndroidSdkCheckup.cs b/UnoCheck/Checkups/AndroidSdkCheckup.cs index 3398b3a9..e494505d 100644 --- a/UnoCheck/Checkups/AndroidSdkCheckup.cs +++ b/UnoCheck/Checkups/AndroidSdkCheckup.cs @@ -202,7 +202,7 @@ You can use the Android SDK Manager to install / update them. { // Provide a default timeout value of 7 minutes if a value is not provided. httpClient.Timeout = TimeSpan.FromMinutes(120); - await Task.WhenAll(downloads.Select(d => Download(httpClient, d))); + await Task.WhenAll(downloads.Where(d => (d.HostArch == null) || (d.HostArch == (Util.IsArm64 ? "aarch64" : "x64"))).Select(d => Download(httpClient, d))); } installer.Install(sdkInstance, installationSet);