diff --git a/Documentation/docs-mobile/building-apps/build-properties.md b/Documentation/docs-mobile/building-apps/build-properties.md index 8ba5425dd68..9be1a904e41 100644 --- a/Documentation/docs-mobile/building-apps/build-properties.md +++ b/Documentation/docs-mobile/building-apps/build-properties.md @@ -27,6 +27,21 @@ rejects it with [NETSDK1242](https://learn.microsoft.com/dotnet/core/tools/sdk-e Use the .NET 10-and-earlier Mono guidance only when targeting a framework where Mono is supported. +.NET 11 Android applications require Android API level 24 or later. +`$(SupportedOSPlatformVersion)` sets the application's deployment minimum and +maps to `//uses-sdk/@android:minSdkVersion` in the Android manifest. It does not +select the target SDK or represent Google Play policy. + +The .NET 11 CoreCLR runtime packs support the following .NET runtime identifiers +(RIDs) and corresponding Android application binary interfaces (ABIs): + +- `android-arm`: `armeabi-v7a` +- `android-arm64`: `arm64-v8a` +- `android-x64`: `x86_64` + +Android NativeAOT is experimental and supports the same three RIDs. RIDs are +distinct from Android ABI names and emulator system-image architectures. + ## AdbTarget The `$(AdbTarget)` property specifies the Android target device the @@ -299,9 +314,9 @@ The default value is `XAJavaInterop1`. ## AndroidCreatePackagePerAbi -A boolean property that determines if a *set* of files--one per ABI -specified in [`$(AndroidSupportedAbis)`](#androidsupportedabis)--should -be created instead of having support for all ABIs in a single `.apk`. +A boolean property that determines if a *set* of files--one per RID +specified in `$(RuntimeIdentifiers)`--should be created instead of having +support for all selected architectures in a single `.apk`. See also the [Building ABI-Specific APKs](/xamarin/android/deploy-test/building-apps/abi-specific-apks) guide. @@ -1305,16 +1320,18 @@ The default value is `false` and the debug symbols, if any, will be preserved wh ## AndroidSupportedAbis -A string property that contains a -semicolon (`;`)-delimited list of ABIs which should be included -into the `.apk`. +This property is no longer supported in .NET 6 and later. Remove it and use +`$(RuntimeIdentifier)` or `$(RuntimeIdentifiers)` with .NET RIDs rather than +Android ABI names. -Supported values include: +For example, the following .NET 11 setting includes all supported CoreCLR +architectures: -- `armeabi-v7a` -- `x86` -- `arm64-v8a` -- `x86_64` +```xml + + android-arm;android-arm64;android-x64 + +``` ## AndroidTlsProvider diff --git a/Documentation/docs-mobile/messages/adb0020.md b/Documentation/docs-mobile/messages/adb0020.md index d6e936adb03..3f1b0e579a5 100644 --- a/Documentation/docs-mobile/messages/adb0020.md +++ b/Documentation/docs-mobile/messages/adb0020.md @@ -28,16 +28,24 @@ documentation][adb]. ## Solution -A solution is to add an additional architecture under the -**Supported architectures** in your project options. +Set the `RuntimeIdentifier` or `RuntimeIdentifiers` MSBuild property to include +a .NET RID whose Android ABI matches the device: -You may also modify the MSBuild property, as in the following example -that includes all ABIs: +- `android-arm` packages the `armeabi-v7a` ABI. +- `android-arm64` packages the `arm64-v8a` ABI. +- `android-x64` packages the `x86_64` ABI. + +For example, the following .NET 11 setting includes all supported CoreCLR +architectures: ```xml -armeabi-v7a;x86;x86_64;arm64-v8a + + android-arm;android-arm64;android-x64 + ``` +Android NativeAOT is experimental and supports the same three RIDs. + [adb]: https://developer.android.com/studio/command-line/adb ## Implementation notes diff --git a/Documentation/docs-mobile/messages/index.md b/Documentation/docs-mobile/messages/index.md index ae176508958..2819f45c478 100644 --- a/Documentation/docs-mobile/messages/index.md +++ b/Documentation/docs-mobile/messages/index.md @@ -145,7 +145,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac. + [XA1028](xa1028.md): The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. + [XA1029](xa1029.md): The 'AotAssemblies' MSBuild property is deprecated. Remove it. For supported .NET 10-and-earlier projects that use Mono, use the 'RunAOTCompilation' MSBuild property instead. CoreCLR and NativeAOT do not use this property. + [XA1035](xa1035.md): The 'BundleAssemblies' property is deprecated and no longer affects the build. Remove it. For supported .NET 10-and-earlier Mono projects, use 'AndroidUseAssemblyStore' with 'AndroidEnableAssemblyCompression' for the former behavior. .NET 11 CoreCLR controls packaged assembly-store behavior and needs no replacement setting. -+ [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). ++ [XA1036](xa1036.md): 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). + [XA1038](xa1038.md): The '{0}' MSBuild property has an invalid value. Value values are {1}. + [XA1039](xa1039.md): The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details. @@ -190,7 +190,7 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla + XA4213: The type '{type}' must provide a public default constructor + [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. + [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. -+ [XA4216](xa4216.md): The deployment target '19' is not supported (the minimum is '21'). Please increase the $(SupportedOSPlatformVersion) property value in your project file. ++ [XA4216](xa4216.md): The deployment target '19' is not supported (the minimum is '24'). Please increase the $(SupportedOSPlatformVersion) property value in your project file. + XA4217: Cannot override Kotlin-generated method '{method}' because it is not a valid Java method name. This method can only be overridden from Kotlin. + [XA4217](xa4217.md): Architecture '{arch}' has Java types which have no counterparts in template architecture '{templateArch}': {types} + [XA4218](xa4218.md): Unable to find //manifest/application/uses-library at path: {path} diff --git a/Documentation/docs-mobile/messages/xa0035.md b/Documentation/docs-mobile/messages/xa0035.md index 34aa000d8a3..1f2087404d8 100644 --- a/Documentation/docs-mobile/messages/xa0035.md +++ b/Documentation/docs-mobile/messages/xa0035.md @@ -23,10 +23,13 @@ property are valid: ```xml - android-arm;android-arm64;android-x86;android-x64 + android-arm;android-arm64;android-x64 ``` +In .NET 11, CoreCLR supports these three RIDs. Android NativeAOT is experimental +and supports the same set. + See the Microsoft documentation on [runtime identifiers][rids] for more information. diff --git a/Documentation/docs-mobile/messages/xa0036.md b/Documentation/docs-mobile/messages/xa0036.md index aff7eddbed7..965444dd6c3 100644 --- a/Documentation/docs-mobile/messages/xa0036.md +++ b/Documentation/docs-mobile/messages/xa0036.md @@ -21,10 +21,14 @@ another text editor and remove ``. Use the ```xml - android-arm;android-arm64;android-x86;android-x64 + android-arm;android-arm64;android-x64 ``` +In .NET 11, CoreCLR supports these three RIDs. Android NativeAOT is experimental +and supports the same set. The `android-x86` RID was available through the +.NET 10 Mono toolchain but is not available in .NET 11. + See the Microsoft documentation on [runtime identifiers][rids] for more information. diff --git a/Documentation/docs-mobile/messages/xa1036.md b/Documentation/docs-mobile/messages/xa1036.md index 7379667ce33..cd811b28e9c 100644 --- a/Documentation/docs-mobile/messages/xa1036.md +++ b/Documentation/docs-mobile/messages/xa1036.md @@ -11,7 +11,7 @@ f1_keywords: ## 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). +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). ``` @@ -28,3 +28,6 @@ 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. + +.NET 11 requires Android API level 24 or later. These two settings describe the +application's deployment minimum; they do not select the target SDK. diff --git a/Documentation/docs-mobile/messages/xa4216.md b/Documentation/docs-mobile/messages/xa4216.md index 9d896e084f9..962f534ff6f 100644 --- a/Documentation/docs-mobile/messages/xa4216.md +++ b/Documentation/docs-mobile/messages/xa4216.md @@ -11,15 +11,15 @@ f1_keywords: ## Example messages ``` -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 '24'). 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. +error XA4216: The deployment target '19' is not supported (the minimum is '24'). 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. +warning XA4216: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '19' is less than API-24, this configuration is not supported. ``` ## Issue @@ -40,3 +40,8 @@ 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. + +.NET 11 requires Android API level 24 or later. `$(SupportedOSPlatformVersion)` +and manifest `minSdkVersion` describe the application's deployment minimum. +Manifest `targetSdkVersion` is separate and can also be affected by the target +framework and Google Play policy.