diff --git a/Configuration.props b/Configuration.props index e93828c5fae..1463c7b8184 100644 --- a/Configuration.props +++ b/Configuration.props @@ -54,6 +54,7 @@ Windows Linux Darwin + $([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()) Microsoft.Android.Sdk.Windows @@ -194,9 +195,9 @@ 7.0 8512546_latest $(AndroidSdkFullPath)\cmdline-tools\$(CommandLineToolsFolder)\bin - - 8129060 - 31.3.1 + + 9364964 + 32.1.9 $(AndroidSdkFullPath)\emulator emulator $(AndroidNdkDirectory)\ndk-build diff --git a/build-tools/scripts/TestApks.targets b/build-tools/scripts/TestApks.targets index 37ca9805f5a..f940b08efcc 100644 --- a/build-tools/scripts/TestApks.targets +++ b/build-tools/scripts/TestApks.targets @@ -18,6 +18,7 @@ 29 + arm64-v8a x86_64 default pixel_4 diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs index e2eb631d9a3..8a2a190bbbd 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; namespace Xamarin.Android.Prepare { @@ -30,10 +31,14 @@ public AndroidToolchain () string XABuildTools30PackagePrefix = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefix] ?? String.Empty; string XAPlatformToolsVersion = GetRequiredProperty (KnownProperties.XAPlatformToolsVersion); string XAPlatformToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XAPlatformToolsPackagePrefix] ?? String.Empty; + bool isArm64Apple = Context.Instance.OS.Flavor == "macOS" && RuntimeInformation.OSArchitecture == Architecture.Arm64; + string emulatorArch = isArm64Apple ? "aarch64" : "x64"; + string systemImageArch = isArm64Apple ? "arm64-v8a" : "x86_64"; // Upstream manifests with version information: // // https://dl-ssl.google.com/android/repository/repository2-1.xml + // https://dl-ssl.google.com/android/repository/repository2-3.xml // * platform APIs // * build-tools // * command-line tools @@ -87,10 +92,10 @@ public AndroidToolchain () dependencyType: AndroidToolchainComponentType.BuildDependency, buildToolVersion: "47.0.0" ), - new AndroidToolchainComponent ($"x86_64-29_r07-{osTag}", - destDir: Path.Combine ("system-images", "android-29", "default", "x86_64"), + new AndroidToolchainComponent (isArm64Apple ? $"{systemImageArch}-29_r08" : $"{systemImageArch}-29_r08-{osTag}", + destDir: Path.Combine ("system-images", "android-29", "default", systemImageArch), relativeUrl: new Uri ("sys-img/android/", UriKind.Relative), - pkgRevision: "7", + pkgRevision: "8", dependencyType: AndroidToolchainComponentType.EmulatorDependency ), new AndroidToolchainComponent ($"android-ndk-r{AndroidNdkVersion}-{osTag}", @@ -123,7 +128,7 @@ public AndroidToolchain () buildToolName: "android-sdk-platform-tools", buildToolVersion: XAPlatformToolsVersion ), - new AndroidToolchainComponent ($"emulator-{osTag}_x64-{EmulatorVersion}", + new AndroidToolchainComponent ($"emulator-{osTag}_{emulatorArch}-{EmulatorVersion}", destDir: "emulator", pkgRevision: EmulatorPkgRevision, dependencyType: AndroidToolchainComponentType.EmulatorDependency