Yes! The Android workload does expose default dependency versions directly in its .props files. Here are the alternative ways to get Android SDK dependencies:
The workload ships default versions in:
/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/<version>/tools/Xamarin.Android.Common.props/usr/local/share/dotnet/packs/Microsoft.Android.Sdk.Darwin/<version>/tools/Xamarin.Installer.Common.props
These contain:
<AndroidSdkBuildToolsVersion>36.0.0</AndroidSdkBuildToolsVersion>
<AndroidSdkPlatformToolsVersion>36.0.0</AndroidSdkPlatformToolsVersion>
<AndroidSdkPlatformVersion>android-36</AndroidSdkPlatformVersion>
<AndroidCommandLineToolsVersion>19.0</AndroidCommandLineToolsVersion>
<JavaSdkVersion>21.0.8</JavaSdkVersion>
<AndroidNdkVersion>26.3.11579264</AndroidNdkVersion>Advantage: No need to run dotnet build against a project — just parse the props file from the installed workload pack.
dotnet msbuild YourProject.csproj -getProperty:AndroidSdkBuildToolsVersion -getProperty:AndroidSdkPlatformVersion -getProperty:JavaSdkVersionThis is faster than running a full build target.
The Xamarin.Android.Build.Tasks.dll contains a CalculateProjectDependencies MSBuild task that computes dependencies based on inputs like AndroidApiLevel, BuildToolsVersion, etc. You could invoke this programmatically if you're already using MSBuild APIs.
| Method | Needs Project? | Speed | Gets Project-Specific Overrides? |
|---|---|---|---|
Parse .props files |
❌ | Fastest | ❌ (defaults only) |
dotnet msbuild -getProperty |
✅ | Fast | ✅ |
dotnet build -t:GetAndroidDependencies |
✅ | Slow | ✅ |
For the extension, parsing the workload's .props files would give you the baseline defaults (API 36, build-tools 36.0.0, etc.) without any MSBuild invocation. You'd only need project-specific queries if the user overrides SupportedOSPlatformVersion or AndroidSdkBuildToolsVersion.