-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
34 changed files
with
355 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Xamarin.Android error XA1036 | ||
description: XA1036 error code | ||
ms.date: 5/22/2023 | ||
--- | ||
# Xamarin.Android error XA1036 | ||
|
||
## Example messages | ||
|
||
``` | ||
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). | ||
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). | ||
``` | ||
|
||
## Issue | ||
|
||
This error indicates that you have a mismatch between the minSdkVersion | ||
element set in your AndroidManifest.xml and the $(SupportedOSPlatformVersion) | ||
property value in your project file. | ||
|
||
|
||
## Solution | ||
|
||
Raise the value of `//uses-sdk/@android:minSdkVersion` in *AndroidManifest.xml* | ||
to match the $(SupportedOSPlatformVersion), or remove `//uses-sdk/@android:minSdkVersion` | ||
from *AndroidManifest.xml* and set $(SupportedOSPlatformVersion) in your project | ||
file if it is unset. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,39 @@ | ||
--- | ||
title: Xamarin.Android warning XA4216 | ||
description: XA4216 warning code | ||
title: Xamarin.Android error XA4216 | ||
description: XA4216 error code | ||
ms.date: 02/07/2019 | ||
--- | ||
# Xamarin.Android warning XA4216 | ||
# Xamarin.Android error XA4216 | ||
|
||
## Example messages | ||
|
||
``` | ||
warning XA4216: AndroidManifest.xml //uses-sdk/@android:minSdkVersion '15' is less than API-16, this configuration is not supported. | ||
error XA4216: The deployment target '19' is not supported (the minimum is '21'). Please increase the $(SupportedOSPlatformVersion) property value in your project file. | ||
``` | ||
|
||
``` | ||
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. | ||
``` | ||
|
||
``` | ||
warning XA4216: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '19' is less than API-21, this configuration is not supported. | ||
``` | ||
|
||
## Issue | ||
|
||
This warning indicates your application is targeting an API level that | ||
Xamarin.Android does not support. | ||
This error or warning indicates your application is targeting an unsupported API level. | ||
|
||
## Solution | ||
|
||
Raise the value of `//uses-sdk/@android:minSdkVersion` or | ||
`//uses-sdk/@android:targetSdkVersion` in *AndroidManifest.xml* to a | ||
higher API level that is supported. | ||
Edit your csproj and increase the '$(SupportedOSPlatformVersion)' | ||
property value to something greater than or equal to the minimum supported version. | ||
|
||
or | ||
|
||
Edit your AndroidManifest.xml and remove `//uses-sdk/@android:minSdkVersion`, | ||
or increase it to something greater than or equal to the minimum supported version. | ||
|
||
or | ||
|
||
Edit your AndroidManifest.xml and remove `//uses-sdk/@android:targetSdkVersion`, | ||
or increase it to something greater than or equal to the minimum supported version. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 20 additions & 1 deletion
21
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.