Edit

Share via


.NET for Android error XA1030

Example messages

The 'RunAOTCompilation' MSBuild property is only supported when trimming is enabled. Edit the project file in a text editor to set 'PublishTrimmed' to 'true' for this build configuration.

Solution

Instead of using:

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <RunAOTCompilation>true</RunAOTCompilation>
  <!-- Either of these disable the linker/trimmer -->
  <PublishTrimmed>false</PublishTrimmed>
  <AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>

Use the default value for $(PublishTrimmed) and $(AndroidLinkMode) instead:

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  <RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup>

Additionally, as mentioned by XA0119, you should not use $(RunAOTCompilation) in Debug configurations.