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] Prefer SupportedOSPlatformVersion over minSdkVersion (#8026)
Fixes: #8040
I noticed that we were not writing a supported (by us)
`//uses-sdk/@android:minSdkVersion` value to the generated
`AndroidManifest.xml` file for projects which included a manifest
that declared a `targetSdkVersion`. In these cases, we would
always write a `//uses-sdk/@android:minSdkVersion` value of `19` to
`AndroidManifest.xml`, as that was the minimum API level the
Android NDK supported. (This was also a mistake, as *MonoVM* has
API-21 as the minimum supported target. This mistake is corrected.)
Fix this to always use the value of `$(SupportedOSPlatformVersion)`
as the `minSdkVersion` attribute in the `AndroidManifest.xml` file.
If this value is not explicitly set in the project file, it will now
default to `$(AndroidMinimumSupportedApiLevel)` instead of
`$(TargetPlatformVersion)`.
The `XA4216` error/warning code has been expanded+repurposed.
The warning that would display when the `minSdkVersion` attribute in
`AndroidManifest.xml` was less than our minimum supported API level
has been converted into an error:
error XA4216: The deployment target '19' is not supported (the minimum is '21').
Please increase (or remove) the //uses-sdk/@android:minSdkVersion value in your project file.
A similar error is now reported when `$(SupportedOSPlatformVersion)`
is less than `$(AndroidMinimumSupportedApiLevel)`
error XA4216: The deployment target '19' is not supported (the minimum is '21').
Please increase the $(SupportedOSPlatformVersion) property value in your project file.
An error condition has been added for when
`//uses-sdk/@android:minSdkVersion` in `AndroidManifest.xml` does not
match `$(SupportedOSPlatformVersion)`:
error XA1036: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '19' does not match the $(SupportedOSPlatformVersion) value '21.0' 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).
A few multidex related tests have been updated/removed as they are
only valid with a `minSdkVersion` of 20 or lower.
Copy file name to clipboardExpand all lines: Documentation/guides/messages/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,8 @@ or 'Help->Report a Problem' in Visual Studio for Mac.
135
135
+[XA1032](xa1032.md):Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.
136
136
+[XA1033](xa1033.md): Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.
137
137
+[XA1035](xa1035.md): The 'BundleAssemblies' property is deprecated and it has no effect on the application build. Equivalent functionality is implemented by the 'AndroidUseAssemblyStore' and 'AndroidEnableAssemblyCompression' properties.
138
+
+[XA1036](xa1036.md): AndroidManifest.xml //uses-sdk/@android:minSdkVersion '29' does not match the $(SupportedOSPlatformVersion) value '21' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed).
139
+
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).
138
140
139
141
## XA2xxx: Linker
140
142
@@ -163,7 +165,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac.
163
165
+ XA4213: The type '{type}' must provide a public default constructor
164
166
+[XA4214](xa4214.md): The managed type \`Library1.Class1\` exists in multiple assemblies: Library1, Library2. Please refactor the managed type names in these assemblies so that they are not identical.
165
167
+[XA4215](xa4215.md): The Java type \`com.contoso.library1.Class1\` is generated by more than one managed type. Please change the \[Register\] attribute so that the same Java type is not emitted.
166
-
+[XA4216](xa4216.md): AndroidManifest.xml //uses-sdk/@android:minSdkVersion '{min_sdk?.Value}' is less than API-{XABuildConfig.NDKMinimumApiAvailable}, this configuration is not supported.
168
+
+[XA4216](xa4216.md): The deployment target '19' is not supported (the minimum is '21'). Please increase the $(SupportedOSPlatformVersion) property value in your project file.
167
169
+ XA4217: Cannot override Kotlin-generated method '{method}' because it is not a valid Java method name. This method can only be overridden from Kotlin.
168
170
+[XA4218](xa4218.md): Unable to find //manifest/application/uses-library at path: {path}
169
171
+ XA4219: Cannot find binding generator for language {language} or {defaultLanguage}.
error XA1036: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '29' does not match the $(SupportedOSPlatformVersion) value '21' in the project file (if there is no $(SupportedOSPlatformVersion) value in the project file, then a default value has been assumed).
12
+
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).
13
+
```
14
+
15
+
## Issue
16
+
17
+
This error indicates that you have a mismatch between the minSdkVersion
18
+
element set in your AndroidManifest.xml and the $(SupportedOSPlatformVersion)
19
+
property value in your project file.
20
+
21
+
22
+
## Solution
23
+
24
+
Raise the value of `//uses-sdk/@android:minSdkVersion` in *AndroidManifest.xml*
25
+
to match the $(SupportedOSPlatformVersion), or remove `//uses-sdk/@android:minSdkVersion`
26
+
from *AndroidManifest.xml* and set $(SupportedOSPlatformVersion) in your project
warning XA4216: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '15' is less than API-16, this configuration is not supported.
11
+
error XA4216: The deployment target '19' is not supported (the minimum is '21'). Please increase the $(SupportedOSPlatformVersion) property value in your project file.
12
+
```
13
+
14
+
```
15
+
error XA4216: The deployment target '19' is not supported (the minimum is '21'). Please increase (or remove) the //uses-sdk/@android:minSdkVersion value in your AndroidManifest.xml.
16
+
```
17
+
18
+
```
19
+
warning XA4216: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '19' is less than API-21, this configuration is not supported.
12
20
```
13
21
14
22
## Issue
15
23
16
-
This warning indicates your application is targeting an API level that
17
-
Xamarin.Android does not support.
24
+
This error or warning indicates your application is targeting an unsupported API level.
18
25
19
26
## Solution
20
27
21
-
Raise the value of `//uses-sdk/@android:minSdkVersion` or
22
-
`//uses-sdk/@android:targetSdkVersion` in *AndroidManifest.xml* to a
23
-
higher API level that is supported.
28
+
Edit your csproj and increase the '$(SupportedOSPlatformVersion)'
29
+
property value to something greater than or equal to the minimum supported version.
30
+
31
+
or
32
+
33
+
Edit your AndroidManifest.xml and remove `//uses-sdk/@android:minSdkVersion`,
34
+
or increase it to something greater than or equal to the minimum supported version.
35
+
36
+
or
37
+
38
+
Edit your AndroidManifest.xml and remove `//uses-sdk/@android:targetSdkVersion`,
39
+
or increase it to something greater than or equal to the minimum supported version.
0 commit comments