Generated banner for Dotnet Maui Doctor
Generated logo for Dotnet Maui Doctor

Dotnet Maui Doctor

.NET (Microsoft)OfficialPublished by .NET (Microsoft)

  • Skill
  • Workflow
  • Software development
  • MIT
  • Low risk

From the author

Diagnoses and fixes .NET MAUI development environment issues. Validates .NET SDK, workloads, Java JDK, Android SDK, Xcode, and Windows SDK. All version requirements discovered dynamically from NuGet WorkloadDependencies.json — never hardcoded. Use when: setting up MAUI development, build errors mentioning SDK/workload/JDK/Android, "Android SDK not found", "Java version" errors, "Xcode not found", environment verification after updates, or any MAUI toolchain issues. Do not use for: non-MAUI .NET projects, Xamarin.Forms apps, runtime app crashes unrelated to environment setup, or app store publishing issues. Works on macOS, Windows, and Linux.
— the description by .NET (Microsoft)

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The .NET MAUI Doctor skill provides a systematic approach to validating and fixing development environments for .NET MAUI. It dynamically retrieves version requirements from NuGet WorkloadDependencies.json to ensure compatibility across macOS, Windows, and Linux. The skill performs comprehensive checks on the .NET SDK, workloads, Microsoft OpenJDK, Android SDK, Xcode, and Windows SDK, offering automated remediation steps while avoiding hardcoded values to maintain alignment with the latest active releases.

What it does

  • Detects the host operating system and loads platform-specific requirements.
  • Validates .NET SDK versions against active releases from official metadata.
  • Checks and installs required .NET MAUI workloads using explicit versioning.
  • Verifies Microsoft OpenJDK installation and configuration without requiring JAVA_HOME.
  • Audits Android SDK components and Xcode versions based on dynamic dependency data.
  • Performs build verification by creating and compiling a temporary test project.

When to use it

  • Setting up a new .NET MAUI development environment.
  • Troubleshooting build errors related to missing SDKs, workloads, or JDKs.
  • Resolving environment-specific errors like Android SDK or Xcode not found.
  • Verifying environment health after performing SDK or OS updates.

Advantages

  • Uses dynamic discovery to ensure version requirements are always current.
  • Prevents common configuration pitfalls like unnecessary JAVA_HOME settings.
  • Provides platform-aware remediation for macOS, Windows, and Linux.
  • Includes automated build verification to confirm environment readiness.

Usage examples

“My .NET MAUI build is failing with an Android SDK error. Can you help?”
The agent will initiate the diagnostic workflow, check the current Android SDK configuration against required versions, and provide commands to install or fix missing components.
“I just updated my OS and now my MAUI project won't build. What should I do?”
The agent will run a full environment validation, checking the .NET SDK, workloads, and platform-specific tools to identify and resolve any regressions caused by the update.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/dotnet/dotnet-maui-doctor/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip dotnet-maui-doctor.zip -d .agents/skills

Documentation by .NET (Microsoft)

.NET MAUI Doctor

Validate and fix .NET MAUI development environments. All version requirements are discovered dynamically from NuGet APIs — never hardcode versions.

When to Use

  • Setting up a new .NET MAUI development environment

  • Build errors mentioning missing SDKs, workloads, JDK, or Android components

  • Errors like "Android SDK not found", "Java version", or "Xcode not found"

  • Verifying environment health after SDK or OS updates

When Not to Use

  • Non-MAUI .NET projects (use standard .NET SDK troubleshooting instead)

  • Xamarin.Forms apps (different toolchain and workload requirements)

  • Runtime app crashes unrelated to environment setup

  • App store publishing or signing issues

  • IDE-specific issues (Visual Studio or VS Code configuration)

Important: .NET Version Currency

Your training data may be outdated regarding .NET versions. .NET ships new major releases annually (November). Always check the releases-index.json (Task 2) to discover the latest active major release — do not assume your training data reflects the current version. For example, if you know about .NET 9.0 but the releases index shows .NET 10.0 as active, use .NET 10.0.

Inputs

  • A development machine running macOS, Windows, or Linux

  • Shell access (Bash on macOS/Linux, PowerShell on Windows)

  • Internet access for NuGet API queries and SDK downloads

  • Admin/sudo access may be required for installing SDKs and workloads

  • Bash prerequisites: curl, jq, and unzip (macOS/Linux)

  • PowerShell prerequisites: Invoke-RestMethod and System.IO.Compression (built-in on Windows)

Behavior

  • Run through ALL tasks autonomously

  • Re-validate after each fix

  • Iterate until complete or no further actions possible

  • After detecting platform (Task 1), load only the matching platform-specific references

Workflow

Task 1: Detect Environment
# macOS
sw_vers && uname -m

# Windows
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"

# Linux
cat /etc/os-release && uname -m

After detection, load the matching platform references:

  • macOS: references/platform-requirements-macos.md, references/installation-commands-macos.md, references/troubleshooting-macos.md

  • Windows: references/platform-requirements-windows.md, references/installation-commands-windows.md, references/troubleshooting-windows.md

  • Linux: references/platform-requirements-linux.md

Task 2: Check .NET SDK
dotnet --info

Compare installed vs latest-sdk from https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json where support-phase is "active".

Task 3: Check MAUI Workloads
WorkloadmacOSWindowsLinux
mauiRequiredRequired❌ Use maui-android
maui-androidAliasAliasRequired
androidRequiredRequiredRequired
iosRequiredOptionalN/A
Task 4: Discover Requirements from NuGet

See references/workload-dependencies-discovery.md for complete process.

Query NuGet for workload manifest → extract WorkloadDependencies.json → get:

  • jdk.version range and jdk.recommendedVersion

  • androidsdk.packages, buildToolsVersion, apiLevel

  • xcode.version range

Task 5: Validate Java JDK

Only Microsoft OpenJDK supported. Verify java -version output contains "Microsoft". See references/microsoft-openjdk.md for detection paths.

Use the JDK version recommended by WorkloadDependencies.json (jdk.recommendedVersion), ensuring it satisfies the jdk.version range. Do not hardcode JDK versions.

JAVA_HOME is NOT required. .NET MAUI tools auto-detect Microsoft OpenJDK installations from known paths. Do not tell users to set JAVA_HOME — it is unnecessary and risks pointing to a non-Microsoft JDK.

JAVA_HOME stateOK?Action
Not set✅None needed — auto-detection works
Set to Microsoft JDK✅None needed
Set to non-Microsoft JDK⚠️Report as anomaly — let user decide to unset or redirect
Task 6: Validate Android SDK

Check packages from androidsdk.packages, buildToolsVersion, apiLevel (Task 4). See references/installation-commands.md for sdkmanager commands.

Task 7: Validate Xcode (macOS Only)
xcodebuild -version

Compare against xcode.version range from Task 4. See references/installation-commands-macos.md.

Task 8: Validate Windows SDK (Windows Only)

The Windows SDK is typically installed as part of the .NET MAUI workload or Visual Studio. See references/installation-commands-windows.md.

Task 9: Remediation

See references/installation-commands.md for all commands.

Key rules:

  • Workloads: Always use --version flag. Never use workload update or workload repair.

  • JDK: Only install Microsoft OpenJDK. Do not set JAVA_HOME (auto-detected).

  • Android SDK: Use sdkmanager (from Android SDK command-line tools). On Windows use sdkmanager.bat.

Task 10: Re-validate

After each fix, re-run the relevant validation task. Iterate until all checks pass.

Validation

A successful run produces:

  • .NET SDK installed and matches an active release

  • All required workloads installed with consistent versions

  • Microsoft OpenJDK detected (java -version contains "Microsoft")

  • All required Android SDK packages installed (per WorkloadDependencies.json)

  • Xcode version in supported range (macOS only)

  • Windows SDK detected (Windows only)

After all checks pass, create and build a test project to confirm the environment actually works:

TEMP_DIR=$(mktemp -d)
dotnet new maui -o "$TEMP_DIR/MauiTest"
dotnet build "$TEMP_DIR/MauiTest"
rm -rf "$TEMP_DIR"

On Windows, use $env:TEMP or New-TemporaryFile for the temp directory.

If the build succeeds, the environment is verified. If it fails, use the error output to diagnose remaining issues.

Run Verification (Optional — Ask User First)

After a successful build, ask the user if they want to launch the app on a target platform to verify end-to-end:

# Replace net10.0 with the current major .NET version
dotnet build -t:Run -f net10.0-android
dotnet build -t:Run -f net10.0-ios        # macOS only
dotnet build -t:Run -f net10.0-maccatalyst # macOS only
dotnet build -t:Run -f net10.0-windows    # Windows only

Only run the target frameworks relevant to the user's platform and intent. This step deploys to an emulator/simulator/device, so confirm with the user before proceeding.

Common Pitfalls

  • maui vs maui-android workload: On Linux, the maui meta-workload is not available — use maui-android instead. On macOS/Windows, maui installs all platform workloads.

  • workload update / workload repair: Never use these commands. Always install workloads with an explicit --version flag to ensure version consistency.

  • Non-Microsoft JDK: Only Microsoft OpenJDK is supported. Other distributions (Oracle, Adoptium, Azul) will cause build failures even if the version is correct.

  • Unnecessary JAVA_HOME: Do not set JAVA_HOME. MAUI auto-detects JDK from known install paths. If JAVA_HOME is set to a non-Microsoft JDK (e.g., Temurin), report this as an anomaly — it may override auto-detection and cause failures. Let the user decide whether to unset it.

  • Hardcoded versions: Never hardcode SDK, workload, or dependency versions. Always discover them dynamically from the NuGet APIs (see Task 4).

  • Android SDK sdkmanager on Windows: Use sdkmanager.bat, not sdkmanager, on Windows.

  • Stale training data: LLM training data may reference outdated .NET versions. Always check the releases-index.json to discover the current active release.

References

  • references/workload-dependencies-discovery.md — NuGet API discovery process

  • references/microsoft-openjdk.md — JDK detection paths, identification, JAVA_HOME

  • references/installation-commands.md — .NET workloads, Android SDK (sdkmanager)

  • references/troubleshooting.md — Common errors and solutions

  • references/platform-requirements-{platform}.md — Platform-specific requirements

  • references/installation-commands-{platform}.md — Platform-specific install commands

  • references/troubleshooting-{platform}.md — Platform-specific troubleshooting

Official docs:

Files

references/troubleshooting.md

Troubleshooting .NET MAUI Environment Issues

Common problems and solutions when setting up or using .NET MAUI.

See also platform-specific troubleshooting:

  • macOS: troubleshooting-macos.md

  • Windows: troubleshooting-windows.md

.NET SDK Issues

"dotnet: command not found"

Cause: .NET SDK not installed or not in PATH.

Solution:

# Check if dotnet exists
which dotnet

# macOS/Linux - Add to PATH if installed via dotnet-install script
export PATH="$PATH:$HOME/.dotnet"

If not installed, see: https://dotnet.microsoft.com/download

"The required workload is not installed"

Cause: MAUI workload not installed.

Solution:

dotnet workload install maui --version $WORKLOAD_VERSION
"Workload version mismatch"

Cause: Workloads from different SDK versions or incomplete installation.

Solution: Reinstall workloads with explicit version:

# First, find the correct workload set version for your SDK
# Query NuGet APIs (see workload-dependencies-discovery.md)

# Then reinstall with explicit version (macOS example — omit ios/maccatalyst on Linux)
dotnet workload install maui android ios maccatalyst --version $WORKLOAD_VERSION

Note: Avoid dotnet workload update or dotnet workload repair as they can cause version inconsistencies.

SDK version conflict with global.json

Cause: Project requires specific SDK version not installed.

Solution:

# Check required version
cat global.json

# Install specific version
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --version X.Y.Z

Java JDK Issues

IMPORTANT: Only Microsoft Build of OpenJDK is supported. Other JDK vendors (Oracle, Azul, Amazon Corretto, Temurin) are NOT supported for .NET MAUI development.

See microsoft-openjdk.md for complete installation paths by platform.

"JAVA_HOME is not set"

This is usually NOT a problem. The .NET MAUI toolchain auto-detects JDK installations without needing JAVA_HOME.

When JAVA_HOME matters:

  • ⚠️ JAVA_HOME is set but points to a non-Microsoft JDK → Report as anomaly; user should unset or redirect to Microsoft JDK

  • ✅ JAVA_HOME is not set → Fine, tools will auto-detect

  • ✅ JAVA_HOME points to Microsoft JDK → Fine

Solution (only if JAVA_HOME is set to wrong JDK):

Report this as an anomaly to the user: "JAVA_HOME is set to a non-Microsoft JDK. .NET MAUI auto-detects Microsoft OpenJDK, so JAVA_HOME is not needed and may cause build issues."

The user can then decide to:

  • Unset JAVA_HOME (lets auto-detection work)

  • Point it to Microsoft JDK if they have a specific reason to keep it set

"Unsupported Java version" or "Wrong JDK vendor"

Cause: JDK version outside required range OR non-Microsoft JDK installed.

Use the JDK version recommended by WorkloadDependencies.json (jdk.recommendedVersion), ensuring it satisfies the jdk.version range. Do not hardcode JDK versions.

Solution: Install the recommended Microsoft OpenJDK version using the official installation guide.

Non-Microsoft JDK detected

Cause: Oracle, Azul, Corretto, or other non-Microsoft JDK is installed and selected.

How to identify: Run java -version - if output does NOT contain "Microsoft", wrong JDK is selected.

Solution:

  1. Install the recommended Microsoft OpenJDK version (see commands above)

  2. If JAVA_HOME is set and points to a non-Microsoft JDK, report this as an anomaly — the user should unset it or point it to the Microsoft JDK path

  3. Optionally uninstall the non-Microsoft JDK

Multiple JDKs installed, wrong one selected

Solution:

# macOS - find Microsoft JDK
/usr/libexec/java_home -V 2>&1 | grep -i microsoft

# Linux - set Microsoft as default
sudo update-java-alternatives --set msopenjdk-{VERSION}-amd64

Android SDK Issues

"Android SDK not found"

Cause: SDK not installed or path not configured.

Solution:

# Check environment variables
echo $ANDROID_HOME
echo $ANDROID_SDK_ROOT

# Common SDK locations:
# macOS: ~/Library/Android/sdk
# Linux: ~/Android/Sdk
# Windows: %LOCALAPPDATA%\Android\Sdk

# If no SDK found, download command-line tools from:
# https://developer.android.com/studio#command-line-tools-only
"Failed to find Build Tools"

Cause: Required build-tools package not installed.

Solution:

# Get build tools version from WorkloadDependencies.json (androidsdk.buildToolsVersion)

# Use sdkmanager (macOS/Linux)
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "build-tools;$BUILD_TOOLS_VERSION"

# Windows
# & "$env:ANDROID_SDK_ROOT\cmdline-tools\latest\bin\sdkmanager.bat" "build-tools;$BUILD_TOOLS_VERSION"
"License not accepted"

Cause: Android SDK licenses not accepted.

Solution:

# macOS/Linux
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses

# Windows
# & "$env:ANDROID_SDK_ROOT\cmdline-tools\latest\bin\sdkmanager.bat" --licenses
"Platform not found: android-XX"

Cause: Target platform not installed.

Solution:

# Get required API level from WorkloadDependencies.json (androidsdk.apiLevel)

# macOS/Linux
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "platforms;android-$API_LEVEL"

# Windows
# & "$env:ANDROID_SDK_ROOT\cmdline-tools\latest\bin\sdkmanager.bat" "platforms;android-$API_LEVEL"
Emulator won't start

Causes & Solutions:

  1. HAXM/KVM not enabled:

    # Linux - check KVM
    kvm-ok
    
    # Enable KVM
    sudo modprobe kvm
  2. Insufficient disk space:

    • Clear AVD cache: ~/.android/avd/

See also: troubleshooting-windows.md for Hyper-V conflicts.


Build Errors

"The target framework 'net10.0-android' is not available"

Cause: Android workload not installed for this SDK.

Solution:

dotnet workload install android --version $WORKLOAD_VERSION
"Could not find android.jar"

Cause: Android platform not installed.

Solution:

# Discover required API level from WorkloadDependencies.json, then:
$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager "platforms;android-$API_LEVEL"
"MSB4019: The imported project was not found"

Cause: Workload not properly installed.

Solution: Reinstall with explicit version:

# Get correct workload version for your SDK band from NuGet APIs, then:
dotnet workload install maui --version $WORKLOAD_VERSION
"NETSDK1147: To build this project, the following workloads must be installed"

Solution: Install the listed workloads with explicit version:

dotnet workload install [workload-name] --version $WORKLOAD_VERSION

Performance Issues

Slow builds

Solutions:

  1. Enable incremental builds (default)

  2. Use Hot Reload during development

  3. Build only necessary platforms:

    dotnet build -f net10.0-android
Slow Android emulator

Solutions:

  1. Enable hardware acceleration (HAXM/KVM/Hyper-V)

  2. Use x86_64 system image (not ARM on Intel)

  3. Increase emulator RAM in AVD settings

  4. Use physical device for testing


Environment Variable Reference

VariablePurposeRequiredNotes
JAVA_HOMEJDK locationNoReport as anomaly if set to non-Microsoft JDK
ANDROID_HOMEAndroid SDK locationNoAuto-detected
ANDROID_SDK_ROOTAndroid SDK locationNoAlternative to ANDROID_HOME
DOTNET_ROOT.NET SDK locationNoUsually auto-detected
PATHMust include dotnetYesRequired for CLI access

Key point about JAVA_HOME:

  • ✅ Not set → Fine, tools auto-detect Microsoft JDK

  • ✅ Set to Microsoft JDK path → Fine

  • ⚠️ Set to non-Microsoft JDK → Anomaly — report to user

Note: The .NET MAUI toolchain auto-detects most paths. Only set these manually if auto-detection fails or wrong JDK is being selected.


Getting Help

Diagnostic Commands
# Full .NET info
dotnet --info

# Workload status
dotnet workload list

# JDK info
java -version

See platform-specific troubleshooting files for additional diagnostic commands.

Resources

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
.NET (Microsoft)
Publisher
.NET (Microsoft) (Official)
Source
dotnet/skills · plugins/dotnet-maui/skills/dotnet-maui-doctor · commit 96c3d68
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by .NET (Microsoft) or .NET (Microsoft).

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download dotnet-maui-doctor.zip