.NET for Android 错误 XA1036

示例消息

error XA1036: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '29' does not match the $(SupportedOSPlatformVersion) value '24' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed).
Either change the value in the AndroidManifest.xml to match the $(SupportedOSPlatformVersion) value, or remove the value in the AndroidManifest.xml (and add a $(SupportedOSPlatformVersion) value to the project file if it doesn't already exist).

问题

此错误表示在 AndroidManifest.xml 中设置的 minSdkVersion 元素与项目文件中的 $(SupportedOSPlatformVersion) 属性值之间不匹配。

解决方案

提高 //uses-sdk/@android:minSdkVersion 中的值以匹配 $(SupportedOSPlatformVersion),或者从 //uses-sdk/@android:minSdkVersion 中删除,并在项目文件中设置 $(SupportedOSPlatformVersion)(如果它未设置)。

.NET 11 需要 Android API 级别 24 或更高版本。 这两个设置描述了应用程序的部署最小值;它们不选择目标 SDK。