You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[xabt] Fix XA4211 warning message to use $(TargetPlatformVersion) (#10197)
Fixes: #10196
Customers reported that the XA4211 warning message contains outdated
property references and blank values for .NET 6+ projects:
AndroidManifest.xml: Warning XA4211 : AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '34' is less than $(TargetFrameworkVersion) ''. Using API-35 for ACW compilation.
The warning was written during the Xamarin.Android timeframe and needs
updating for .NET 6+:
- **Property name**: `$(TargetFrameworkVersion)` should be
`$(TargetPlatformVersion)` for .NET 6+
- **Blank values**: The empty `''` appears because the message
references the wrong property
## Changes
Updated the XA4211 message in `Resources.resx`:
- Changed message text from `$(TargetFrameworkVersion)` to
`$(TargetPlatformVersion)`
- Updated comment documentation to reference the correct property
- Updated parameter description to reflect "target platform version
number"
This occurs when developers explicitly set a lower target SDK version
in their AndroidManifest.xml:
<uses-sdk android:targetSdkVersion="34" />
The warning is reasonable to show, but the message text should be
accurate for modern .NET Android projects.
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -604,10 +604,10 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla
604
604
<comment>The following are literal names and should not be translated: Mono.Android.Export.dll, ExportAttribute, ExportFieldAttribute.</comment>
605
605
</data>
606
606
<dataname="XA4211"xml:space="preserve">
607
-
<value>AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '{0}' is less than $(TargetFrameworkVersion) '{1}'. Using API-{2} for ACW compilation.</value>
608
-
<comment>The following are literal names and should not be translated: AndroidManifest.xml, //uses-sdk/@android:targetSdkVersion , $(TargetFrameworkVersion), API-{2}, ACW
607
+
<value>AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '{0}' is less than $(TargetPlatformVersion) '{1}'. Using API-{2} for ACW compilation.</value>
608
+
<comment>The following are literal names and should not be translated: AndroidManifest.xml, //uses-sdk/@android:targetSdkVersion , $(TargetPlatformVersion), API-{2}, ACW
0 commit comments