.NET fel i Android XA1030

Exempelmeddelanden

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.

Lösning

I stället för att använda:

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

Använd standardvärdet för $(PublishTrimmed) och $(AndroidLinkMode) i stället:

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

Dessutom bör du, som nämnts av XA0119, inte använda $(RunAOTCompilation) i Debug konfigurationer.