Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Documentation/docs-mobile/messages/xa1040.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: .NET for Android warning XA1040
description: XA1040 warning code
ms.date: 02/24/2025
---
# .NET for Android warning XA1040

## Example messages

```
warning XA1040: The CoreCLR runtime is currently experimental in .NET for Android.
warning XA1040: The NativeAOT runtime is currently experimental in .NET for Android.
```

## Issue

MonoVM is the default, supported runtime for .NET for Android.

Other runtimes are currently experimental, such as:

* CoreCLR, used via `$(UseMonoRuntime)=false`
* NativeAOT, used via `$(PublishAot)=true`

## Solution

To silence this warning, you can either:

* Use MonoVM by removing `$(UseMonoRuntime)=false` or
`$(PublishAot)=true` from your project file.

* Set `$(AndroidAllowExperimentalRuntime)` to `true` in your project
file.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,11 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
<value>The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/net-android/androidx for more details.</value>
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.</comment>
</data>
<data name="XA1040" xml:space="preserve">
<value>The {0} runtime is currently experimental in .NET for Android.</value>
<comment>The following are literal names and should not be translated: .NET.
{0} - The name of the .NET runtime, such as CoreCLR or NativeAOT.</comment>
</data>
<data name="XA4241" xml:space="preserve">
<value>Java dependency '{0}' is not satisfied.</value>
<comment>The following are literal names and should not be translated: Java.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,11 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
FormatArguments="AndroidFastDeploymentType;9"
Condition=" '$(AndroidFastDeploymentType)' != '' "
/>
<AndroidWarning Code="XA1040"
ResourceName="XA1040"
FormatArguments="$(_AndroidRuntime)"
Condition=" '$(_AndroidRuntime)' != 'MonoVM' and '$(AndroidAllowExperimentalRuntime)' != 'true' "
/>
</Target>

<Target Name="_CheckNonIdealConfigurations"
Expand Down