dotnet/maui · error · ArgumentException
No AppLinks implementation was found, if in Android make sur
Error message
No AppLinks implementation was found, if in Android make sure you installed the Microsoft.Maui.Controls.AppLinks
What it means
Thrown by the Application.AppLinks getter when an IAppIndexingProvider IS registered but its AppLinks property returns null. The provider exists yet has no IAppLinks implementation behind it, which on Android typically means the AppLinks platform package is not installed.
Source
Thrown at src/Controls/src/Core/Application/Application.cs:83
/// <summary>
/// Terminates the application.
/// </summary>
public void Quit()
{
Handler?.Invoke(ApplicationHandler.TerminateCommandKey);
}
/// <summary>
/// Gets the <see cref="IAppLinks"/> for deep linking and app indexing.
/// </summary>
public IAppLinks AppLinks
{
get
{
if (_appIndexProvider == null)
throw new ArgumentException("No IAppIndexingProvider was provided");
if (_appIndexProvider.AppLinks == null)
throw new ArgumentException("No AppLinks implementation was found, if in Android make sure you installed the Microsoft.Maui.Controls.AppLinks");
return _appIndexProvider.AppLinks;
}
}
/// <summary>
/// Sets the current application instance.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public static void SetCurrentApplication(Application value) => Current = value;
/// <summary>
/// Gets or sets the current application instance.
/// </summary>
public static Application? Current { get; set; }
Page? _singleWindowMainPage;
/// <summary>View on GitHub (pinned to f377ff1c5e)
Solutions
- On Android, add the Microsoft.Maui.Controls.AppLinks NuGet package to the Android head project.
- Ensure the platform AppLinks implementation is not trimmed/AOT-removed in release builds (add a linker preserve if needed).
- Confirm the registered IAppIndexingProvider actually returns a non-null IAppLinks for the current platform.
Example fix
<!-- before: Android head project has no AppLinks package --> <!-- after: add to the Android .csproj --> <PackageReference Include="Microsoft.Maui.Controls.AppLinks" Version="$(MauiVersion)" />
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify the platform AppLinks package is referenced on Android. // <PackageReference Include="Microsoft.Maui.Controls.AppLinks" .../>
Try / catch
try { var links = Application.Current.AppLinks; }
catch (ArgumentException ex) when (ex.Message.Contains("AppLinks implementation"))
{ /* install Microsoft.Maui.Controls.AppLinks on Android */ } Prevention
- Add Microsoft.Maui.Controls.AppLinks to the Android head project from the start when using deep links.
- Preserve the AppLinks implementation from trimming/linking in release builds.
- Verify the registered provider returns a non-null IAppLinks on every target platform.
When it happens
Trigger: Reading Application.AppLinks where _appIndexProvider != null but _appIndexProvider.AppLinks == null, hitting the second ArgumentException with the Android-specific hint.
Common situations: Android project missing the Microsoft.Maui.Controls.AppLinks NuGet package; provider registered from a shared project but the Android implementation assembly not loaded; partial deep-link setup where the registration exists but the backing type was stripped.
Related errors
- No IAppIndexingProvider was provided
- Environment variable 'ANDROID_SDK_ROOT' or 'ANDROID_HOME' mu
- JAVA_HOME environment variable isn't set. Set it to your JDK
- UI Test application path not specified.
- Unexpected platform (expected: android) in device: {deviceDe
AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13).
Data as JSON: /api/errors/652f38d3f564c26b.
Report an issue: GitHub.