diff --git a/.external b/.external index b0955939ad3..71b3d68c546 100644 --- a/.external +++ b/.external @@ -1,2 +1,2 @@ -xamarin/monodroid:main@c36049815ca04379194dd32f402f56beb5b992d3 +xamarin/monodroid:release/8.0.1xx@7edfb4a9c1daa49216d193db6aa8b986483cf5fa mono/mono:2020-02@6dd9def57ce969ca04a0ecd9ef72c0a8f069112d diff --git a/.gitmodules b/.gitmodules index ab79ccab656..fcf1e2f78c3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,7 +9,7 @@ [submodule "external/Java.Interop"] path = external/Java.Interop url = https://github.com/xamarin/java.interop.git - branch = main + branch = release/8.0.1xx [submodule "external/lz4"] path = external/lz4 url = https://github.com/lz4/lz4.git diff --git a/Configuration.props b/Configuration.props index fa0577572ae..06323961aa3 100644 --- a/Configuration.props +++ b/Configuration.props @@ -137,16 +137,8 @@ $(XABuildToolsPackagePrefixWindows) 34 34.0.0 - - f6d24b187cc6bd534c6c37604205171784ac5621. - 91936d4ee3ccc839f0addd53c9ebf087b1e39251. - - $(XABuildTools30PackagePrefixMacOS) - $(XABuildTools30PackagePrefixWindows) - 30.0.3 - 30.0.3 - 34.0.1 + 34.0.5 False 1.15.1 $(NUGET_PACKAGES) @@ -187,8 +179,8 @@ avdmanager.bat $(AndroidSdkFullPath)\tools $(AndroidToolPath)\bin - 7.0 - 8512546_latest + 11.0 + 10406996_latest $(AndroidSdkFullPath)\cmdline-tools\$(CommandLineToolsFolder)\bin 9364964 diff --git a/Directory.Build.props b/Directory.Build.props index e5e3b2e4cd2..b6e76813d65 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -34,13 +34,16 @@ * Major/Minor match Android stable API level, such as 30.0 for API 30. * Bump first digit of the patch version for feature releases (and reset the first two digits to 0) --> - 34.0.0 - rc.2 + 34.0.1 + $(AndroidPackVersion.LastIndexOf(".")) + $(AndroidPackVersion.Substring(0,$(AndroidPackVersionPatchIndex))) + $(AndroidPackVersion.Substring($([MSBuild]::Add($(AndroidPackVersionPatchIndex), 1)))) + rtm - 3.0.0 + 3.1.1 1.0.0 0.11.4 13.0.1 diff --git a/Documentation/guides/building-apps/build-properties.md b/Documentation/guides/building-apps/build-properties.md index 54dc92d2606..be7378f3c1a 100644 --- a/Documentation/guides/building-apps/build-properties.md +++ b/Documentation/guides/building-apps/build-properties.md @@ -469,6 +469,15 @@ Support for this property was added in Xamarin.Android 5.1. This property is `False` by default. +## AndroidEnableObsoleteOverrideInheritance + +A boolean property that determines if bound methods automatically inherit `[Obsolete]` +attributes from methods they override. + +Support for this property was added in .NET 8. + +This property is `True` by default. + ## AndroidEnablePreloadAssemblies A boolean property that controls @@ -987,9 +996,12 @@ merging *AndroidManifest.xml* files. This is an enum-style property where `legacy` selects the original C# implementation and `manifestmerger.jar` selects Google's Java implementation. -The default value is currently `legacy`. This will change to -`manifestmerger.jar` in a future release to align behavior with -Android Studio. +The default value is currently `manifestmerger.jar`. If you want to +use the old version add the following to your csproj + +```xml +legacy +``` Google's merger enables support for `xmlns:tools="http://schemas.android.com/tools"` as described in the [Android documentation][manifest-merger]. diff --git a/Documentation/guides/building-apps/build-targets.md b/Documentation/guides/building-apps/build-targets.md index fc6697ce83f..4e62ceab39e 100644 --- a/Documentation/guides/building-apps/build-targets.md +++ b/Documentation/guides/building-apps/build-targets.md @@ -91,6 +91,20 @@ MSBuild /t:Install ProjectName.csproj /p:AdbTarget=-e Calls the [`GetAndroidDependencies`](#getandroiddependencies) target, then installs the Android SDK packages specified in the `@(AndroidDependency)` item group. +```dotnetcli +dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=" "-p:JavaSdkDirectory=" +``` + +The `-f net8.0-android` is required as this target is a .NET Android specific target. If you omit this argument +you will get the following error: + +``` +error MSB4057: The target "InstallAndroidDependencies" does not exist in the project. +``` + +The `AndroidSdkDirectory` and `JavaSdkDirectory` properties are required as we need to know where to install the required components. These directories can be empty or existing. Sdk components +will be installed on top on an existing sdk installation. + The [`$(AndroidManifestType)`](~/android/deploy-test/building-apps/build-properties.md#androidmanifesttype) MSBuild property controls which [Visual Studio SDK Manager repository](~/android/get-started/installation/android-sdk.md?tabs=windows#repository-selection) diff --git a/Documentation/guides/messages/xa1039.md b/Documentation/guides/messages/xa1039.md new file mode 100644 index 00000000000..ec43ce6721b --- /dev/null +++ b/Documentation/guides/messages/xa1039.md @@ -0,0 +1,47 @@ +--- +title: Xamarin.Android warning XA1039 +description: XA1039 warning code +ms.date: 1/10/2024 +--- +# Xamarin.Android warning XA1039 + +## Example messages + +``` +warning XA1039: 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. +``` + +## Issue + +Outdated "Android Support Library" packages are no longer supported in .NET 9: + +* `Xamarin.Android.Arch.*` +* `Xamarin.Android.Support.*` + +The underlying Java libraries are no longer supported by Google since the final +28.0.0 release. See the [Android Support Library Documentation][support] for +details. + +Some example prefixes of the newer, supported AndroidX packages are: + +* `Xamarin.AndroidX.*` +* `Xamarin.AndroidX.Arch.*` + +For more information about the Android Support libraries or AndroidX, see: + +* [Android Support Library Documentation][support] +* [AndroidX Documentation](https://developer.android.com/jetpack/androidx) + +[support]: https://developer.android.com/topic/libraries/support-library/packages + +## Solution + +Remove all NuGet package references to `Xamarin.Android.Support` or +`Xamarin.Android.Arch` in favor of the new AndroidX equivalents. + +This also can occur if you are using a NuGet package with a transitive +dependency on the Android support packages. In this case, you will need to +remove the package or contact the package author. + +See the [AndroidX migration documentation](https://aka.ms/xamarin/androidx) for +details. diff --git a/Documentation/guides/messages/xa5207.md b/Documentation/guides/messages/xa5207.md index 56ac2937fcd..90e89e21925 100644 --- a/Documentation/guides/messages/xa5207.md +++ b/Documentation/guides/messages/xa5207.md @@ -7,14 +7,35 @@ ms.date: 06/26/2019 ## Example messages -``` +```dotnetcli XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change your Xamarin.Android project to target an API version that is installed. ``` ## Issue -In order to build a project, the Android SDK Platform matching the target API level must be installed. +In order to build a project, the Android SDK Platform matching the target API level must be installed. ## Solution -Use the Android SDK Manager to install the Android SDK Platform for the desired API level. +Use the Android SDK Manager (Tools > Android > Android SDK Manager...) to install the Android SDK Platform for the desired API level. Alternatively you can install the missing API level by running the following command from a terminal or command prompt: + +```dotnetcli +dotnet build -t:InstallAndroidDependencies -f net8.0-android "-p:AndroidSdkDirectory=" +``` + +Part of the new .net android system is when upgrading projects you will automatically be +upgraded to the latest API level. For example net7.0-android allowed you to target API 33, +but net8.0-android will automatically target API 34. If you want to keep your current +target API level you will need to add the 'uses-sdk' `android:targetSdkVersion` to your `AndroidManifest.xml` file. + +```xml + + + + +``` + +You might then need to run the `InstallAndroidDependencies` target as mentioned above to ensure that the required API level is installed. diff --git a/LICENSE b/LICENSE.TXT similarity index 94% rename from LICENSE rename to LICENSE.TXT index a9eb82df55a..984713a4962 100644 --- a/LICENSE +++ b/LICENSE.TXT @@ -1,8 +1,6 @@ -Xamarin.Android SDK - The MIT License (MIT) -Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors All rights reserved. @@ -23,4 +21,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Localize/loc/cs/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/cs/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 57b29ff1153..f6586705089 100644 --- a/Localize/loc/cs/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/cs/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/cs/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/cs/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 2af7bcd2bcf..1d128039578 100644 --- a/Localize/loc/cs/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/cs/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/cs/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/cs/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index f94907d61fa..2359c767a9b 100644 --- a/Localize/loc/cs/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/cs/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Správce sady Android SDK...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Otevřít správce sady Android SDK...]]> + Android > Správce sady Android SDK…), nebo změňte projekt .NET pro Android tak, aby cílil na nainstalovanou verzi rozhraní API.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/de/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/de/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 416a91ea7f3..b37273d5fd6 100644 --- a/Localize/loc/de/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/de/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/de/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/de/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 9e7711054ce..81656e3e69f 100644 --- a/Localize/loc/de/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/de/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/de/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/de/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index a533166ebb9..26a9c423984 100644 --- a/Localize/loc/de/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/de/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Android-SDK-Manager...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Android-SDK-Manager öffnen...]]> + Android > Android SDK-Manager...), oder ändern Sie das .NET Android-Projekt so, dass es auf eine installierte API-Version abzielt.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/es/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/es/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index c1f58460510..d97d95502ad 100644 --- a/Localize/loc/es/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/es/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/es/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/es/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 6249b186046..f7542997362 100644 --- a/Localize/loc/es/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/es/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/es/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/es/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 078081cfbbc..576868789e9 100644 --- a/Localize/loc/es/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/es/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Administrador de Android SDK...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Abrir el Administrador de Android SDK...]]> + Android > Android SDK Manager...) o cambie el proyecto .NET Android para que se dirija a una versión de la API que esté instalada.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/fr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/fr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 0d77453419b..571b9b17ced 100644 --- a/Localize/loc/fr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/fr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/fr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/fr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index ebe089dd64e..9bb670674bf 100644 --- a/Localize/loc/fr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/fr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/fr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/fr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index e63f00d1a22..664ff88d2b2 100644 --- a/Localize/loc/fr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/fr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Gestionnaire SDK Android...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Ouvrir le Gestionnaire SDK Android...]]> + Android > Gestionnaire SDK Android...), ou modifiez le projet Android .NET pour cibler une version d’API installée.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/it/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/it/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 4115cf37263..b3052669481 100644 --- a/Localize/loc/it/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/it/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/it/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/it/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 2efc8d263c8..c9969e1ba3c 100644 --- a/Localize/loc/it/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/it/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/it/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/it/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 0f09feaab4f..a053422e937 100644 --- a/Localize/loc/it/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/it/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Gestione Android SDK...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Apri Gestione Android SDK...]]> + Android > Gestione Android SDK...) oppure modifica il progetto Android .NET in modo che sia destinato a una versione API installata.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/ja/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ja/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index a077b3871d8..86369bde99e 100644 --- a/Localize/loc/ja/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ja/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/ja/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ja/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 1c634412cc2..4339d218eaf 100644 --- a/Localize/loc/ja/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ja/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/ja/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/ja/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 6ec4c9ac8eb..ba2589f94ce 100644 --- a/Localize/loc/ja/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/ja/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - [Android]5D; > [Android SDK マネージャー...]5D;]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - [Android SDK マネージャーを開く...]5D;]]> + [Android]5D; > [Android SDK マネージャー]5D;...) にインストールするか、インストールされている API バージョンを対象とするように .NET Android プロジェクトを変更してください。]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/ko/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ko/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 4c11f582cf5..437763db39a 100644 --- a/Localize/loc/ko/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ko/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/ko/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ko/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 650b88247b1..055c047f213 100644 --- a/Localize/loc/ko/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ko/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/ko/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/ko/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index d989e0217f8..85344811a11 100644 --- a/Localize/loc/ko/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/ko/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Android SDK 관리자...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Android SDK 관리자 열기...]]> + Android > Android SDK 관리자...) 설치된 API 버전을 대상으로 하도록 .NET Android 프로젝트를 변경합니다.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/pl/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/pl/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 945c15e757b..37c8bf71751 100644 --- a/Localize/loc/pl/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/pl/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/pl/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/pl/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index f23f6216abf..0166133ee4b 100644 --- a/Localize/loc/pl/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/pl/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/pl/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/pl/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index be85483ab31..7821a088777 100644 --- a/Localize/loc/pl/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/pl/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Menedżer zestawów Android SDK...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Otwórz Menedżer zestawów SDK dla systemu Android...]]> + Android > Menedżer zestawów Android SDK...) lub zmień projekt platformy .NET dla systemu Android, tak aby był przeznaczony dla zainstalowanej wersji interfejsu API.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index d354cc8e5c8..bbe1854eb90 100644 --- a/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 6658a10cea8..c45b5bcf109 100644 --- a/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/pt-BR/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/pt-BR/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/pt-BR/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 54e9045ba51..7f3a2cecafb 100644 --- a/Localize/loc/pt-BR/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/pt-BR/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Gerenciador de SDK Android...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Abrir o Gerenciador de SDK Android...]]> + Android > Gerenciador de SDK Android...) ou altere o projeto do Android .NET para direcionar a uma versão de API instalada.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/ru/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ru/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 1eb7d78f47c..88cac291c43 100644 --- a/Localize/loc/ru/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ru/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/ru/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/ru/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index fb67dc19c2f..a5a70383648 100644 --- a/Localize/loc/ru/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/ru/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/ru/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/ru/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 489c35d80b0..83357e0ea25 100644 --- a/Localize/loc/ru/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/ru/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Диспетчер SDK Android…]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Открыть Диспетчер SDK Android…]]> + Android > Диспетчер SDK Android...) или измените проект .NET Android, выбрав для него в качестве цели установленную версию API.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/tr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/tr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 9b8611baeb6..0a170e08624 100644 --- a/Localize/loc/tr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/tr/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/tr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/tr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 5cd5922e507..fffa1f923b0 100644 --- a/Localize/loc/tr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/tr/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/tr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/tr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index e4a3aeaf274..df69fadd938 100644 --- a/Localize/loc/tr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/tr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - Android > Android SDK Yöneticisi...]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - Android SDK Yöneticisi'ni Aç...]]> + Android > Android SDK Yöneticisi...) veya .NET Android projesini, yüklü bir API sürümünü hedefleyecek şekilde değiştirin.]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 41d686a0d52..2f5d90b3342 100644 --- a/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 2a3496f9d53..aba4d641e40 100644 --- a/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/zh-Hans/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/zh-Hans/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/zh-Hans/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 89b965f9e8e..a37bd031631 100644 --- a/Localize/loc/zh-Hans/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/zh-Hans/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - “ Android”>“Android SDK 管理器”…]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - “打开 Android SDK 管理器”…]]> + Android > Android SDK 管理器...),要么将 .NET Android 项目更改为面向已安装的 API 版本。]]> + + Android > Android SDK Manager...]]> + diff --git a/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl b/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl index 8c490c513ce..93e4d41a1a7 100644 --- a/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + diff --git a/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl b/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl index 133e19f0903..e4a16c9bc7b 100644 --- a/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl +++ b/Localize/loc/zh-Hant/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.json.lcl @@ -36,6 +36,15 @@ + + + + + + + + + \ No newline at end of file diff --git a/Localize/loc/zh-Hant/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl b/Localize/loc/zh-Hant/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl index 3c34695d749..f3229bbe1a7 100644 --- a/Localize/loc/zh-Hant/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl +++ b/Localize/loc/zh-Hant/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl @@ -617,10 +617,13 @@ - + - + + + + @@ -644,10 +647,13 @@ - + - + + + + @@ -741,12 +747,24 @@ + + + + + + + + + - + - + + + + @@ -1094,19 +1112,25 @@ - + - + + + + - + - + + + + @@ -1265,10 +1289,13 @@ - + - + + + + @@ -1382,28 +1409,34 @@ - + - + + + + - + - Android > Android SDK Manager...]]> + - [Android]5D; > [Android SDK 管理員...]5D;]]> + - + - Open Android SDK Manager...]]> + Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed.]]> - [開啟 Android SDK 管理員...]5D;]]> + Android > Android SDK 管理員...),或將 .NET Android 專案變更為針對已安裝的 API 版本為目標。]]> + + Android > Android SDK Manager...]]> + diff --git a/NuGet.config b/NuGet.config index 1ed561d2bd3..2783eb6d08f 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,6 +2,14 @@ + + + + + + + + @@ -11,9 +19,11 @@ - - - + + + + + diff --git a/build-tools/automation/azure-pipelines-nightly.yaml b/build-tools/automation/azure-pipelines-nightly.yaml index a67b701fbb3..4370dc175d1 100644 --- a/build-tools/automation/azure-pipelines-nightly.yaml +++ b/build-tools/automation/azure-pipelines-nightly.yaml @@ -20,6 +20,10 @@ resources: type: github name: xamarin/monodroid endpoint: xamarin + - repository: maui + type: github + name: dotnet/maui + endpoint: xamarin # Global variables variables: @@ -114,6 +118,7 @@ stages: restoreNUnitConsole: false updateMono: false xaprepareScenario: EmulatorTestDependencies + jdkTestFolder: $(JAVA_HOME_11_X64) - template: yaml-templates/run-dotnet-preview.yaml parameters: @@ -122,9 +127,6 @@ stages: displayName: prepare java.interop $(XA.Build.Configuration) continueOnError: false - - script: echo "##vso[task.setvariable variable=Java8SdkDirectory]$JAVA_HOME_8_X64" - displayName: set Java8SdkDirectory - - template: yaml-templates/start-stop-emulator.yaml parameters: specificImage: true @@ -154,6 +156,7 @@ stages: emulatorMSBuildArgs: -p:TestAvdExtraBootArgs=-writable-system jobName: SystemApplicationTests jobTimeout: 120 + jdkTestFolder: $HOME/android-toolchain/jdk-17 testSteps: - template: run-nunit-tests.yaml parameters: @@ -186,6 +189,10 @@ stages: steps: - template: agent-cleanser/v1.yml@yaml-templates + - script: | + echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17" + displayName: set JAVA_HOME to $HOME/android-toolchain/jdk-17 + - template: yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true @@ -193,6 +200,7 @@ stages: restoreNUnitConsole: false updateMono: false xaprepareScenario: EmulatorTestDependencies + jdkTestFolder: $HOME/android-toolchain/jdk-17 - task: DownloadPipelineArtifact@2 inputs: @@ -239,6 +247,10 @@ stages: steps: - template: agent-cleanser/v1.yml@yaml-templates + - script: | + echo "##vso[task.setvariable variable=JAVA_HOME]$HOME/android-toolchain/jdk-17" + displayName: set JAVA_HOME to $HOME/android-toolchain/jdk-17 + - template: yaml-templates/setup-test-environment.yaml parameters: installTestSlicer: true @@ -246,6 +258,7 @@ stages: restoreNUnitConsole: false updateMono: false xaprepareScenario: EmulatorTestDependencies + jdkTestFolder: $HOME/android-toolchain/jdk-17 - task: DownloadPipelineArtifact@2 inputs: diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 8d9db7ce126..8d28320f2f4 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -37,9 +37,6 @@ resources: endpoint: xamarin parameters: -- name: provisionatorChannel - type: string - default: latest # Support for launching a build against a Provisionator PR (e.g., pr/[github-account-name]/[pr-number]) as a means to test in-progress Provisionator changes - name: macTestAgentsUseCleanImages # Test agents we do not need to clean up when finished because they are not reused default: true @@ -83,8 +80,6 @@ variables: # Stage and Job "display names" are shortened because they are combined to form the name of the corresponding GitHub check. stages: - template: yaml-templates/build-macos.yaml - parameters: - provisionatorChannel: ${{ parameters.provisionatorChannel }} - template: yaml-templates/build-windows.yaml @@ -107,7 +102,6 @@ stages: - template: yaml-templates/setup-test-environment.yaml parameters: provisionClassic: false - provisionatorChannel: ${{ parameters.provisionatorChannel }} installLegacyDotNet: false restoreNUnitConsole: false updateMono: false @@ -267,8 +261,6 @@ stages: - template: yaml-templates/setup-ubuntu.yaml - template: yaml-templates/setup-test-environment.yaml - parameters: - provisionatorChannel: ${{ parameters.provisionatorChannel }} - task: DownloadPipelineArtifact@2 inputs: @@ -347,7 +339,6 @@ stages: parameters: xaSourcePath: $(Build.SourcesDirectory)/xamarin-android provisionClassic: false - provisionatorChannel: ${{ parameters.provisionatorChannel }} installLegacyDotNet: false restoreNUnitConsole: false updateMono: false @@ -359,9 +350,9 @@ stages: forceReinstallCredentialProvider: true - script: | - echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_11_X64% - echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_11_X64% - displayName: set JI_JAVA_HOME, JAVA_HOME + echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% + echo ##vso[task.setvariable variable=JAVA_HOME]%JAVA_HOME_17_X64% + displayName: set JI_JAVA_HOME, JAVA_HOME to $(JAVA_HOME_17_X64) - task: DownloadPipelineArtifact@2 inputs: diff --git a/build-tools/automation/yaml-templates/build-linux.yaml b/build-tools/automation/yaml-templates/build-linux.yaml index 12ea459a70e..859ab2b4b46 100644 --- a/build-tools/automation/yaml-templates/build-linux.yaml +++ b/build-tools/automation/yaml-templates/build-linux.yaml @@ -40,15 +40,24 @@ stages: path: ${{ parameters.checkoutPath }} persistCredentials: ${{ parameters.checkoutPersistCredentials }} - - checkout: monodroid - clean: true - submodules: recursive - path: s/xamarin-android/external/monodroid - persistCredentials: true + # Always checkout a second resource to ensure we are using multi-repo checkout behavior + # https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path + - checkout: maui - - script: rm -rf external/monodroid/external/xamarin-android - workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android - displayName: delete external xamarin-android submodule + - ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: + - checkout: monodroid + clean: true + submodules: recursive + path: s/xamarin-android/external/monodroid + persistCredentials: true + + - script: rm -rf external/monodroid/external/xamarin-android + workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android + displayName: delete external xamarin-android submodule + + - script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration) + workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android + displayName: make prepare-external-git-dependencies - template: setup-ubuntu.yaml @@ -57,10 +66,6 @@ stages: inputs: forceReinstallCredentialProvider: true - - script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration) - workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android - displayName: make prepare-external-git-dependencies - - script: make jenkins PREPARE_CI=1 PREPARE_AUTOPROVISION=1 CONFIGURATION=$(XA.Build.Configuration) workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-android displayName: make jenkins diff --git a/build-tools/automation/yaml-templates/build-macos.yaml b/build-tools/automation/yaml-templates/build-macos.yaml index d0ecd1dc33c..23d400ada95 100644 --- a/build-tools/automation/yaml-templates/build-macos.yaml +++ b/build-tools/automation/yaml-templates/build-macos.yaml @@ -11,7 +11,6 @@ parameters: jobName: mac_build_create_installers jobDisplayName: macOS > Build nugetArtifactName: $(NuGetArtifactName) - provisionatorChannel: latest repositoryAlias: self stageName: mac_build stageDisplayName: Mac @@ -49,7 +48,6 @@ stages: parameters: installerArtifactName: ${{ parameters.installerArtifactName }} nugetArtifactName: ${{ parameters.nugetArtifactName }} - provisionatorChannel: ${{ parameters.provisionatorChannel }} testAssembliesArtifactName: ${{ parameters.testAssembliesArtifactName }} - powershell: | diff --git a/build-tools/automation/yaml-templates/build-windows.yaml b/build-tools/automation/yaml-templates/build-windows.yaml index 133c87ba616..389b67f8afb 100644 --- a/build-tools/automation/yaml-templates/build-windows.yaml +++ b/build-tools/automation/yaml-templates/build-windows.yaml @@ -38,8 +38,8 @@ stages: - template: clean.yaml - script: | - echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_11_X64% - displayName: set JI_JAVA_HOME + echo ##vso[task.setvariable variable=JI_JAVA_HOME]%JAVA_HOME_17_X64% + displayName: set JI_JAVA_HOME to $(JAVA_HOME_17_X64) - template: use-dot-net.yaml parameters: diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index 8ab2c3a041d..59a2dd2f10b 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -3,7 +3,6 @@ parameters: xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android makeMSBuildArgs: '' nugetArtifactName: $(NuGetArtifactName) - provisionatorChannel: latest testAssembliesArtifactName: $(TestAssembliesArtifactName) steps: @@ -19,55 +18,50 @@ steps: inputs: forceReinstallCredentialProvider: true -- task: provisionator@2 - displayName: Install Xcode - inputs: - github_token: $(GitHub.Token) - provisioning_script: ${{ parameters.xaSourcePath }}/build-tools/provisioning/xcode.csx - provisioning_extra_args: '-v -v -v -v' - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} - - script: make prepare-update-mono CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 workingDirectory: ${{ parameters.xaSourcePath }} displayName: make prepare-update-mono -# Clone 'monodroid' without submodules -- checkout: monodroid - clean: true - path: s/xamarin-android/external/monodroid +# Always checkout a second resource to ensure we are using multi-repo checkout behavior +# https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops#checkout-path +- checkout: maui -# Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded -- script: git config submodule."external/xamarin-android".update none - workingDirectory: xamarin-android/external/monodroid - displayName: Ignore XA submodule +- script: > + ls -l /Applications && + sudo xcode-select --switch /Applications/Xcode_14.2.app && + xcode-select --print-path + displayName: Use Xcode 14.2 + condition: and(succeeded(), eq(variables['MicroBuildSignType'], 'Real')) -# Clone 'monodroid' with the rest of the submodules -- checkout: monodroid - submodules: recursive - path: s/xamarin-android/external/monodroid - persistCredentials: true +- ${{ if ne(variables['System.PullRequest.IsFork'], 'True') }}: + # Clone 'monodroid' without submodules + - checkout: monodroid + clean: true + path: s/xamarin-android/external/monodroid -- script: rm -rf external/monodroid/external/xamarin-android - workingDirectory: ${{ parameters.xaSourcePath }} - displayName: delete legacy xamarin-android submodule + # Tell git to ignore the 'xamarin-android' submodule, which is large and unneeded + - script: git config submodule."external/xamarin-android".update none + workingDirectory: xamarin-android/external/monodroid + displayName: Ignore XA submodule -- script: rm -rf external/opentk - workingDirectory: ${{ parameters.xaSourcePath }} - displayName: delete legacy opentk submodule + # Clone 'monodroid' with the rest of the submodules + - checkout: monodroid + submodules: recursive + path: s/xamarin-android/external/monodroid + persistCredentials: true -- script: rm -rf external/sqlite - workingDirectory: ${{ parameters.xaSourcePath }} - displayName: delete legacy sqlite submodule + - script: rm -rf external/monodroid/external/xamarin-android + workingDirectory: ${{ parameters.xaSourcePath }} + displayName: delete legacy xamarin-android submodule + + - script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration) + workingDirectory: ${{ parameters.xaSourcePath }} + displayName: make prepare-external-git-dependencies - task: CodeQL3000Init@0 displayName: CodeQL 3000 Init condition: and(succeeded(), eq(variables['Codeql.Enabled'], 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) -- script: make prepare-external-git-dependencies PREPARE_CI=1 CONFIGURATION=$(XA.Build.Configuration) - workingDirectory: ${{ parameters.xaSourcePath }} - displayName: make prepare-external-git-dependencies - # Prepare and Build everything - script: make jenkins CONFIGURATION=$(XA.Build.Configuration) PREPARE_CI=1 PREPARE_AUTOPROVISION=1 MSBUILD_ARGS='${{ parameters.makeMSBuildArgs }}' workingDirectory: ${{ parameters.xaSourcePath }} diff --git a/build-tools/automation/yaml-templates/install-microbuild-tooling.yaml b/build-tools/automation/yaml-templates/install-microbuild-tooling.yaml index 5da2b01a0d9..a57dd9561a1 100644 --- a/build-tools/automation/yaml-templates/install-microbuild-tooling.yaml +++ b/build-tools/automation/yaml-templates/install-microbuild-tooling.yaml @@ -9,6 +9,10 @@ steps: forceReinstallCredentialProvider: true condition: ${{ parameters.condition }} +- task: UsePythonVersion@0 + inputs: + versionSpec: 3.11.x + # ESRP signing requires minimum azure client version 2.8.0 - template: azure-tools/az-client-update.yml@yaml-templates parameters: diff --git a/build-tools/automation/yaml-templates/run-emulator-tests.yaml b/build-tools/automation/yaml-templates/run-emulator-tests.yaml index cd43adf44bf..e3484dd5c5b 100644 --- a/build-tools/automation/yaml-templates/run-emulator-tests.yaml +++ b/build-tools/automation/yaml-templates/run-emulator-tests.yaml @@ -4,6 +4,7 @@ parameters: emulatorMSBuildArgs: '' jobName: CheckTimeZoneInfoIsCorrectNode1 jobTimeout: 360 + jdkTestFolder: $(JAVA_HOME_17_X64) testSteps: [] jobs: @@ -20,12 +21,17 @@ jobs: steps: - template: agent-cleanser/v1.yml@yaml-templates + - script: | + echo "##vso[task.setvariable variable=JAVA_HOME]${{ parameters.jdkTestFolder }}" + displayName: set JAVA_HOME to ${{ parameters.jdkTestFolder }} + - template: setup-test-environment.yaml parameters: installLegacyDotNet: false restoreNUnitConsole: false updateMono: false xaprepareScenario: EmulatorTestDependencies + jdkTestFolder: ${{ parameters.jdkTestFolder }} - task: DownloadPipelineArtifact@2 inputs: diff --git a/build-tools/automation/yaml-templates/run-installer.yaml b/build-tools/automation/yaml-templates/run-installer.yaml index e7db3bf471f..b66b0209ada 100644 --- a/build-tools/automation/yaml-templates/run-installer.yaml +++ b/build-tools/automation/yaml-templates/run-installer.yaml @@ -1,6 +1,5 @@ parameters: provisionExtraArgs: -vv -f - provisionatorChannel: latest steps: - task: DownloadPipelineArtifact@2 @@ -38,6 +37,4 @@ steps: provisioning_script: $(XA.Provisionator.Args) provisioning_extra_args: ${{ parameters.provisionExtraArgs }} # Disabled on Windows on .NET release branches - condition: and(succeeded(), ne(variables['agent.os'], 'Linux'), or(eq(variables.IsRelOrTargetingRel, 'False'), eq(variables['agent.os'], 'Darwin'))) - env: - PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }} + condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'), ne(variables['agent.os'], 'Linux'), or(eq(variables.IsRelOrTargetingRel, 'False'), eq(variables['agent.os'], 'Darwin'))) diff --git a/build-tools/automation/yaml-templates/setup-test-environment.yaml b/build-tools/automation/yaml-templates/setup-test-environment.yaml index 6b98286ab37..bcd91d29145 100644 --- a/build-tools/automation/yaml-templates/setup-test-environment.yaml +++ b/build-tools/automation/yaml-templates/setup-test-environment.yaml @@ -1,8 +1,7 @@ parameters: configuration: $(XA.Build.Configuration) xaSourcePath: $(System.DefaultWorkingDirectory) - updateVS: false - jdkTestFolder: $(JAVA_HOME_11_X64) + jdkTestFolder: $(JAVA_HOME_17_X64) remove_dotnet: false installTestSlicer: false installApkDiff: true @@ -24,21 +23,16 @@ steps: clean: true submodules: recursive -- ${{ if eq(parameters.updateVS, true) }}: - - template: update-vs.yaml - parameters: - xasourcePath: ${{ parameters.xaSourcePath }} - - script: | echo "##vso[task.setvariable variable=JI_JAVA_HOME]${{ parameters.jdkTestFolder }}" echo "##vso[task.setvariable variable=DOTNET_TOOL_PATH]${{ parameters.xaSourcePath }}/bin/${{ parameters.configuration }}/dotnet/dotnet" - displayName: set JI_JAVA_HOME + displayName: set JI_JAVA_HOME to ${{ parameters.jdkTestFolder }} condition: and(succeeded(), ne(variables['agent.os'], 'Windows_NT')) - script: | echo ##vso[task.setvariable variable=JI_JAVA_HOME]${{ parameters.jdkTestFolder }} echo ##vso[task.setvariable variable=DOTNET_TOOL_PATH]${{ parameters.xaSourcePath }}\bin\${{ parameters.configuration }}\dotnet\dotnet.exe - displayName: set JI_JAVA_HOME + displayName: set JI_JAVA_HOME to ${{ parameters.jdkTestFolder }} condition: and(succeeded(), eq(variables['agent.os'], 'Windows_NT')) # Install .NET 6 for legacy tests diff --git a/build-tools/automation/yaml-templates/setup-ubuntu.yaml b/build-tools/automation/yaml-templates/setup-ubuntu.yaml index c18d1340df5..4dd8d7062b5 100644 --- a/build-tools/automation/yaml-templates/setup-ubuntu.yaml +++ b/build-tools/automation/yaml-templates/setup-ubuntu.yaml @@ -13,9 +13,6 @@ steps: sudo apt install -y --no-install-recommends mono-complete nuget msbuild displayName: install mono preview -- script: sudo apt upgrade - displayName: update packages - - template: use-dot-net.yaml parameters: remove_dotnet: true diff --git a/build-tools/automation/yaml-templates/update-vs.yaml b/build-tools/automation/yaml-templates/update-vs.yaml deleted file mode 100644 index 22154203e59..00000000000 --- a/build-tools/automation/yaml-templates/update-vs.yaml +++ /dev/null @@ -1,17 +0,0 @@ -parameters: - xaSourcePath: $(System.DefaultWorkingDirectory) - condition: eq(variables['agent.os'], 'Windows_NT') - -steps: -- task: provisionator@2 - displayName: update VS 2019 - timeoutInMinutes: 60 - inputs: - github_token: $(Github.Token) - provisioning_script: ${{ parameters.xaSourcePath }}\build-tools\provisioning\vs2019.csx - provisioning_extra_args: -vv - condition: ${{ parameters.condition }} - -- template: environment/win/vs-msbuild.v1.yml@yaml-templates # Display (in log) VS installation(s) including installation status with associated MSBuild location(s) - parameters: - condition: ${{ parameters.condition }} diff --git a/build-tools/create-packs/Directory.Build.targets b/build-tools/create-packs/Directory.Build.targets index ff6d4f99933..689142072ac 100644 --- a/build-tools/create-packs/Directory.Build.targets +++ b/build-tools/create-packs/Directory.Build.targets @@ -47,7 +47,6 @@ <_GlobalProperties Include="-p:Configuration=$(Configuration)" /> - <_GlobalProperties Include="-p:NuGetLicense=$(NuGetLicense)" /> <_GlobalProperties Include="-p:IncludeSymbols=False" /> @@ -85,7 +84,7 @@ @@ -103,7 +102,7 @@ /> - <_WLExtractedFiles Include="$(_SdkManifestsFolder)temp\LICENSE" /> + <_WLExtractedFiles Include="$(_SdkManifestsFolder)temp\LICENSE.TXT" /> <_WLExtractedFiles Include="$(_SdkManifestsFolder)temp\data\*" /> diff --git a/build-tools/create-packs/License.targets b/build-tools/create-packs/License.targets index b711f0a54fb..d25cf36da9c 100644 --- a/build-tools/create-packs/License.targets +++ b/build-tools/create-packs/License.targets @@ -1,12 +1,12 @@ - + Microsoft © Microsoft Corporation. All rights reserved. https://github.com/xamarin/xamarin-android $(XamarinAndroidSourcePath)external\monodroid\tools\scripts\License.txt - $(XamarinAndroidSourcePath)LICENSE - LICENSE + $(XamarinAndroidSourcePath)LICENSE.TXT + LICENSE.TXT _GetLicense;$(BeforePack) diff --git a/build-tools/provisioning/vs2019.csx b/build-tools/provisioning/vs2019.csx deleted file mode 100644 index 8acaf3a3833..00000000000 --- a/build-tools/provisioning/vs2019.csx +++ /dev/null @@ -1,3 +0,0 @@ -VisualStudio (VisualStudioChannel.Stable, VisualStudioTier.Enterprise, 16, @"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise", true) - .Workload (VisualStudioWorkload.ManagedDesktop) - .Workload (VisualStudioWorkload.NetCrossPlat); diff --git a/build-tools/provisioning/xcode.csx b/build-tools/provisioning/xcode.csx deleted file mode 100644 index 8aafbaf8e16..00000000000 --- a/build-tools/provisioning/xcode.csx +++ /dev/null @@ -1,3 +0,0 @@ -if (IsMac) { - Xcode ("13.4").XcodeSelect (); -} diff --git a/build-tools/scripts/TestApks.targets b/build-tools/scripts/TestApks.targets index 484bf5eadde..95ba391d170 100644 --- a/build-tools/scripts/TestApks.targets +++ b/build-tools/scripts/TestApks.targets @@ -371,7 +371,6 @@ @@ -381,7 +380,6 @@ /> @@ -392,7 +390,6 @@ /> diff --git a/build-tools/scripts/XAVersionInfo.targets b/build-tools/scripts/XAVersionInfo.targets index a96bcd8f4d1..c30f614b13e 100644 --- a/build-tools/scripts/XAVersionInfo.targets +++ b/build-tools/scripts/XAVersionInfo.targets @@ -82,8 +82,8 @@ <_AndroidPackBranch>$([System.Text.RegularExpressions.Regex]::Replace('$(XAVersionBranch)', '[^a-zA-Z0-9-]', '-')) <_AndroidPackLabel Condition=" '$(_AndroidPackLabel)' == '' and ('$(XAVersionBranch)' == 'main' or $(XAVersionBranch.StartsWith('release/')))">$(AndroidPackVersionSuffix).$(PackVersionCommitCount) <_AndroidPackLabel Condition=" '$(_AndroidPackLabel)' == '' ">ci.$(_AndroidPackBranch).$(PackVersionCommitCount) - $(AndroidPackVersion)-$(_AndroidPackLabel) - $(AndroidPackVersion).$(PackVersionCommitCount) + $(AndroidPackVersionMajorMinor).$([MSBuild]::Add($(AndroidPackVersionPatch), $(PackVersionCommitCount))) + $(AndroidPackVersionLong).0 diff --git a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs index a4df4d587f1..ea4e25770b3 100644 --- a/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs +++ b/build-tools/xaprepare/xaprepare/Application/KnownProperties.cs @@ -65,12 +65,6 @@ static class KnownProperties public const string XABuildToolsPackagePrefixWindows = "XABuildToolsPackagePrefixWindows"; public const string XABuildToolsPackagePrefixLinux = "XABuildToolsPackagePrefixLinux"; public const string XABuildToolsPackagePrefix = "XABuildToolsPackagePrefix"; - public const string XABuildTools30Folder = "XABuildTools30Folder"; - public const string XABuildTools30Version = "XABuildTools30Version"; - public const string XABuildTools30PackagePrefixMacOS = "XABuildTools30PackagePrefixMacOS"; - public const string XABuildTools30PackagePrefixWindows = "XABuildTools30PackagePrefixWindows"; - public const string XABuildTools30PackagePrefixLinux = "XABuildTools30PackagePrefixLinux"; - public const string XABuildTools30PackagePrefix = "XABuildTools30PackagePrefix"; public const string XABinRelativeInstallPrefix = "XABinRelativeInstallPrefix"; public const string XAInstallPrefix = "XAInstallPrefix"; public const string XAPlatformToolsVersion = "XAPlatformToolsVersion"; diff --git a/build-tools/xaprepare/xaprepare/Application/NullableAttributes.cs b/build-tools/xaprepare/xaprepare/Application/NullableAttributes.cs deleted file mode 100644 index 35dbd04b0d1..00000000000 --- a/build-tools/xaprepare/xaprepare/Application/NullableAttributes.cs +++ /dev/null @@ -1,13 +0,0 @@ -#if !NETCOREAPP -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Diagnostics.CodeAnalysis -{ - /// Specifies that an output may be null even if the corresponding type disallows it. - [AttributeUsage (AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)] - internal sealed class MaybeNullAttribute : Attribute - { } -} -#endif diff --git a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in index 4f461e18369..b0220aa9717 100644 --- a/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in +++ b/build-tools/xaprepare/xaprepare/Application/Properties.Defaults.cs.in @@ -69,12 +69,6 @@ namespace Xamarin.Android.Prepare properties.Add (KnownProperties.XABuildToolsPackagePrefixWindows, StripQuotes ("@XABuildToolsPackagePrefixWindows@")); properties.Add (KnownProperties.XABuildToolsPackagePrefixLinux, StripQuotes ("@XABuildToolsPackagePrefixLinux@")); properties.Add (KnownProperties.XABuildToolsPackagePrefix, StripQuotes ("@XABuildToolsPackagePrefix@")); - properties.Add (KnownProperties.XABuildTools30Folder, StripQuotes (@"@XABuildTools30Folder@")); - properties.Add (KnownProperties.XABuildTools30Version, StripQuotes ("@XABuildTools30Version@")); - properties.Add (KnownProperties.XABuildTools30PackagePrefixMacOS, StripQuotes ("@XABuildTools30PackagePrefixMacOS@")); - properties.Add (KnownProperties.XABuildTools30PackagePrefixWindows, StripQuotes ("@XABuildTools30PackagePrefixWindows@")); - properties.Add (KnownProperties.XABuildTools30PackagePrefixLinux, StripQuotes ("@XABuildTools30PackagePrefixLinux@")); - properties.Add (KnownProperties.XABuildTools30PackagePrefix, StripQuotes ("@XABuildTools30PackagePrefix@")); properties.Add (KnownProperties.XABinRelativeInstallPrefix, StripQuotes (@"@XABinRelativeInstallPrefix@")); properties.Add (KnownProperties.XAInstallPrefix, StripQuotes (@"@XAInstallPrefix@")); properties.Add (KnownProperties.XAPlatformToolsVersion, StripQuotes ("@XAPlatformToolsVersion@")); diff --git a/build-tools/xaprepare/xaprepare/Application/Utilities.cs b/build-tools/xaprepare/xaprepare/Application/Utilities.cs index eb2a9393525..e594209db44 100644 --- a/build-tools/xaprepare/xaprepare/Application/Utilities.cs +++ b/build-tools/xaprepare/xaprepare/Application/Utilities.cs @@ -867,154 +867,7 @@ void LogError (string message) public static string GetRelativePath (string relativeTo, string path) { - return GetRelativePath (relativeTo, path, Context.Instance.OS.DefaultStringComparison); + return Xamarin.Android.Tools.PathUtil.GetRelativePath (relativeTo, path, Context.Instance.OS.DefaultStringComparison); } - - // Adapted from CoreFX sources - public static string GetRelativePath (string relativeTo, string path, StringComparison comparisonType) - { - if (String.IsNullOrEmpty (relativeTo)) - throw new ArgumentException ("must not be null or empty", nameof (relativeTo)); - - if (String.IsNullOrEmpty (path)) - throw new ArgumentException ("must not be null or empty", nameof (path)); - - relativeTo = Path.GetFullPath (relativeTo); - path = Path.GetFullPath (path); - - // Need to check if the roots are different- if they are we need to return the "to" path. - if (!AreRootsEqual (relativeTo, path, comparisonType)) - return path; - - int commonLength = GetCommonPathLength (relativeTo, path, ignoreCase: comparisonType == StringComparison.OrdinalIgnoreCase); - - // If there is nothing in common they can't share the same root, return the "to" path as is. - if (commonLength == 0) - return path; - - // Trailing separators aren't significant for comparison - int relativeToLength = relativeTo.Length; - if (EndsInDirectorySeparator (relativeTo)) - relativeToLength--; - - bool pathEndsInSeparator = EndsInDirectorySeparator (path); - int pathLength = path.Length; - if (pathEndsInSeparator) - pathLength--; - - // If we have effectively the same path, return "." - if (relativeToLength == pathLength && commonLength >= relativeToLength) - return "."; - - // We have the same root, we need to calculate the difference now using the - // common Length and Segment count past the length. - // - // Some examples: - // - // C:\Foo C:\Bar L3, S1 -> ..\Bar - // C:\Foo C:\Foo\Bar L6, S0 -> Bar - // C:\Foo\Bar C:\Bar\Bar L3, S2 -> ..\..\Bar\Bar - // C:\Foo\Foo C:\Foo\Bar L7, S1 -> ..\Bar - - var sb = new StringBuilder (Math.Max (relativeTo.Length, path.Length)); - - // Add parent segments for segments past the common on the "from" path - if (commonLength < relativeToLength) { - sb.Append (".."); - - for (int i = commonLength + 1; i < relativeToLength; i++) { - if (IsDirectorySeparator (relativeTo[i])) { - sb.Append (Path.DirectorySeparatorChar); - sb.Append (".."); - } - } - } else if (IsDirectorySeparator (path[commonLength])) { - // No parent segments and we need to eat the initial separator - // (C:\Foo C:\Foo\Bar case) - commonLength++; - } - - // Now add the rest of the "to" path, adding back the trailing separator - int differenceLength = pathLength - commonLength; - if (pathEndsInSeparator) - differenceLength++; - - if (differenceLength > 0) { - if (sb.Length > 0) { - sb.Append (Path.DirectorySeparatorChar); - } - - sb.Append(path, commonLength, differenceLength); - } - - return sb.ToString (); - } - - // Adapted from CoreFX sources - static bool AreRootsEqual (string first, string second, StringComparison comparisonType) - { - int firstRootLength = GetRootLength (first); - int secondRootLength = GetRootLength (second); - - return firstRootLength == secondRootLength - && String.Compare ( - strA: first, - indexA: 0, - strB: second, - indexB: 0, - length: firstRootLength, - comparisonType: comparisonType) == 0; - } - - // Adapted from CoreFX sources - static int GetCommonPathLength (string first, string second, bool ignoreCase) - { - int commonChars = EqualStartingCharacterCount (first, second, ignoreCase: ignoreCase); - - // If nothing matches - if (commonChars == 0) - return commonChars; - - // Or we're a full string and equal length or match to a separator - if (commonChars == first.Length && (commonChars == second.Length || IsDirectorySeparator (second[commonChars]))) - return commonChars; - - if (commonChars == second.Length && IsDirectorySeparator (first[commonChars])) - return commonChars; - - // It's possible we matched somewhere in the middle of a segment e.g. C:\Foodie and C:\Foobar. - while (commonChars > 0 && !IsDirectorySeparator (first[commonChars - 1])) - commonChars--; - - return commonChars; - } - - // Adapted from CoreFX sources - static unsafe int EqualStartingCharacterCount (string first, string second, bool ignoreCase) - { - if (String.IsNullOrEmpty (first) || string.IsNullOrEmpty (second)) - return 0; - - int commonChars = 0; - fixed (char* f = first) { - fixed (char* s = second) { - char* l = f; - char* r = s; - char* leftEnd = l + first.Length; - char* rightEnd = r + second.Length; - - while (l != leftEnd && r != rightEnd && (*l == *r || (ignoreCase && char.ToUpperInvariant ((*l)) == char.ToUpperInvariant ((*r))))) { - commonChars++; - l++; - r++; - } - } - } - - return commonChars; - } - - // Adapted from CoreFX sources - static bool EndsInDirectorySeparator (string path) => path.Length > 0 && IsDirectorySeparator (path[path.Length - 1]); } } diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs index 442a897ef6a..24675bcba58 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs @@ -5,8 +5,8 @@ namespace Xamarin.Android.Prepare { class BuildAndroidPlatforms { - public const string AndroidNdkVersion = "26"; - public const string AndroidNdkPkgRevision = "26.0.10792818"; + public const string AndroidNdkVersion = "26b"; + public const string AndroidNdkPkgRevision = "26.1.10909125"; public const int NdkMinimumAPI = 21; public const int NdkMinimumAPILegacy32 = 21; diff --git a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs index 4062ba8681e..6560909ed13 100644 --- a/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs +++ b/build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs @@ -26,9 +26,6 @@ public AndroidToolchain () string XABuildToolsFolder = GetRequiredProperty (KnownProperties.XABuildToolsFolder); string XABuildToolsVersion = GetRequiredProperty (KnownProperties.XABuildToolsVersion); string XABuildToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XABuildToolsPackagePrefix] ?? String.Empty; - string XABuildTools30Folder = GetRequiredProperty (KnownProperties.XABuildTools30Folder); - string XABuildTools30Version = GetRequiredProperty (KnownProperties.XABuildTools30Version); - string XABuildTools30PackagePrefix = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefix] ?? String.Empty; string XAPlatformToolsVersion = GetRequiredProperty (KnownProperties.XAPlatformToolsVersion); string XAPlatformToolsPackagePrefix = Context.Instance.Properties [KnownProperties.XAPlatformToolsPackagePrefix] ?? String.Empty; bool isArm64Apple = Context.Instance.OS.Flavor == "macOS" && RuntimeInformation.OSArchitecture == Architecture.Arm64; @@ -75,11 +72,11 @@ public AndroidToolchain () new AndroidPlatformComponent ("platform-33_r02", apiLevel: "33", pkgRevision: "2"), new AndroidPlatformComponent ("platform-34-ext7_r01", apiLevel: "34", pkgRevision: "1"), - new AndroidToolchainComponent ("sources-33_r01", - destDir: Path.Combine ("sources", "android-33"), + new AndroidToolchainComponent ("sources-34_r01", + destDir: Path.Combine ("sources", "android-34"), pkgRevision: "1", dependencyType: AndroidToolchainComponentType.BuildDependency, - buildToolVersion: "33.1" + buildToolVersion: "34.1" ), new AndroidToolchainComponent ("docs-24_r01", destDir: "docs", @@ -111,12 +108,6 @@ public AndroidToolchain () buildToolName: "android-sdk-build-tools", buildToolVersion: $"{XABuildToolsVersion}" ), - new AndroidToolchainComponent ($"{XABuildTools30PackagePrefix}build-tools_r{XABuildTools30Version}-{altOsTag}", - destDir: Path.Combine ("build-tools", XABuildTools30Folder), - isMultiVersion: true, - buildToolName: "android-sdk-build-tools", - buildToolVersion: $"{XABuildTools30Version}" - ), new AndroidToolchainComponent ($"commandlinetools-{cltOsTag}-{CommandLineToolsVersion}", destDir: Path.Combine ("cmdline-tools", CommandLineToolsFolder), isMultiVersion: true, diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs b/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs index ffebbf4e2cb..ee0cff61fb5 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_Get_Android_BuildTools.cs @@ -21,17 +21,6 @@ public Step_Get_Android_BuildTools () packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-macosx.zip", prefix: XABuildToolsPackagePrefixMacOS)); packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-windows.zip", prefix: XABuildToolsPackagePrefixWindows)); packages.Add ((package: $"build-tools_r{XABuildToolsVersion}-linux.zip", prefix: XABuildToolsPackagePrefixLinux)); - - // build-tools 30, for DX tests - string XABuildTools30Version = Context.Instance.Properties [KnownProperties.XABuildTools30Version] ?? String.Empty; - string XABuildTools30PackagePrefixMacOS = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixMacOS] ?? string.Empty; - string XABuildTools30PackagePrefixWindows = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixWindows] ?? string.Empty; - string XABuildTools30PackagePrefixLinux = Context.Instance.Properties [KnownProperties.XABuildTools30PackagePrefixLinux] ?? string.Empty; - if (!string.IsNullOrEmpty (XABuildTools30Version)) { - packages.Add ((package: $"build-tools_r{XABuildTools30Version}-macosx.zip", prefix: XABuildTools30PackagePrefixMacOS)); - packages.Add ((package: $"build-tools_r{XABuildTools30Version}-windows.zip", prefix: XABuildTools30PackagePrefixWindows)); - packages.Add ((package: $"build-tools_r{XABuildTools30Version}-linux.zip", prefix: XABuildTools30PackagePrefixLinux)); - } } protected override async Task Execute (Context context) diff --git a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs index 8884a090c3a..c022a9f391b 100644 --- a/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs +++ b/build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetPreview.cs @@ -57,11 +57,11 @@ protected override async Task Execute (Context context) var dotnets = new [] { "net6", "net7", "current" }; foreach (var dotnet in dotnets) { var destination = Path.Combine (sdk_manifests, context.Properties.GetRequiredValue (KnownProperties.DotNetMonoManifestVersionBand), $"microsoft.net.workload.mono.toolchain.{dotnet}"); - foreach (var file in Directory.GetFiles (string.Format (Configurables.Paths.MicrosoftNETWorkloadMonoToolChainDir, dotnet), "WorkloadManifest.*")) { + foreach (var file in Directory.GetFiles (string.Format (Configurables.Paths.MicrosoftNETWorkloadMonoToolChainDir, dotnet))) { Utilities.CopyFileToDir (file, destination); } destination = Path.Combine (sdk_manifests, context.Properties.GetRequiredValue (KnownProperties.DotNetEmscriptenManifestVersionBand), $"microsoft.net.workload.emscripten.{dotnet}"); - foreach (var file in Directory.GetFiles (string.Format (Configurables.Paths.MicrosoftNETWorkloadEmscriptenDir, dotnet), "WorkloadManifest.*")) { + foreach (var file in Directory.GetFiles (string.Format (Configurables.Paths.MicrosoftNETWorkloadEmscriptenDir, dotnet))) { Utilities.CopyFileToDir (file, destination); } } diff --git a/build-tools/xaprepare/xaprepare/xaprepare.csproj b/build-tools/xaprepare/xaprepare/xaprepare.csproj index 2d5dc260e70..6730c7adae9 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.csproj +++ b/build-tools/xaprepare/xaprepare/xaprepare.csproj @@ -44,6 +44,10 @@ + + + + diff --git a/build-tools/xaprepare/xaprepare/xaprepare.targets b/build-tools/xaprepare/xaprepare/xaprepare.targets index 3ba0ccfd582..0201bbf4a34 100644 --- a/build-tools/xaprepare/xaprepare/xaprepare.targets +++ b/build-tools/xaprepare/xaprepare/xaprepare.targets @@ -102,12 +102,6 @@ - - - - - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fb02dc87077..202a1b1ce84 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,24 +1,28 @@ - + https://github.com/dotnet/installer - e1fd7d964980ed478fa30457cf750e81105caee1 + 461c7766428ba2782725d89d95d3f4f414ff8c92 - + https://github.com/dotnet/runtime - 287c10d2539d47268a1083c4d533cf84124900cf + 62304a6d7085e32672ec988835eab41d89b82e25 - + https://github.com/dotnet/runtime - 287c10d2539d47268a1083c4d533cf84124900cf + 62304a6d7085e32672ec988835eab41d89b82e25 - + + https://github.com/dotnet/runtime + 62304a6d7085e32672ec988835eab41d89b82e25 + + https://github.com/dotnet/emsdk - 1999c8c8ab7473a7e1c5b7bdf5ba6d9a985a69cc + 9a29abdd764a4de0f253ed368871877a47725247 - + https://github.com/dotnet/cecil - a112f15aa032c029b7d9c77df3427111d93cf407 + 45dd3a73dd5b64b010c4251303b3664bb30df029 diff --git a/eng/Versions.props b/eng/Versions.props index 5099b035dd7..7f3a8ff84e0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,16 +1,17 @@ - 8.0.100-rc.2.23468.1 - 8.0.0-rc.2.23466.4 - 8.0.0-rc.2.23466.4 + 8.0.101-servicing.23614.6 + 8.0.3-servicing.24114.15 + 8.0.3 + 8.0.3 7.0.0-beta.22103.1 7.0.0-beta.22103.1 - 8.0.0-rc.2.23463.1 - $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion) + 8.0.3 + $(MicrosoftNETWorkloadEmscriptenCurrentManifest80100Version) 7.0.100-rc.1.22410.7 - 0.11.4-alpha.23461.1 - $(MicrosoftNETCoreAppRefPackageVersion) + 0.11.4-alpha.23509.2 + 8.0.0 diff --git a/external/Java.Interop b/external/Java.Interop index 75d8221d44b..3c5cf34b0e3 160000 --- a/external/Java.Interop +++ b/external/Java.Interop @@ -1 +1 @@ -Subproject commit 75d8221d44bb3fb0781f73b4fa53c99da7aa8d06 +Subproject commit 3c5cf34b0e3cc9427521530db9aa4b4abe39d20d diff --git a/external/Java.Interop.override.props b/external/Java.Interop.override.props index 5242a70af3f..d9c13475ad0 100644 --- a/external/Java.Interop.override.props +++ b/external/Java.Interop.override.props @@ -3,6 +3,10 @@ $(MSBuildThisFileDirectory)xamarin-android-tools True + + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-8473eeb9/nuget/v3/index.json; + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-647b468f/nuget/v3/index.json; + diff --git a/external/monodroid.override.props b/external/monodroid.override.props index 8cbac6945cf..e29c38a3a21 100644 --- a/external/monodroid.override.props +++ b/external/monodroid.override.props @@ -2,6 +2,10 @@ $(MSBuildThisFileDirectory)xamarin-android-tools + + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-8473eeb9/nuget/v3/index.json; + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-647b468f/nuget/v3/index.json; + diff --git a/external/xamarin-android-tools b/external/xamarin-android-tools index 8a971d94a3f..08a69900df2 160000 --- a/external/xamarin-android-tools +++ b/external/xamarin-android-tools @@ -1 +1 @@ -Subproject commit 8a971d94a3fa2f0e8f69c5cf742c6836c14be1cd +Subproject commit 08a69900df23e9f95057f3cacae72bd40d640a27 diff --git a/external/xamarin-android-tools.override.props b/external/xamarin-android-tools.override.props new file mode 100644 index 00000000000..1e921795c87 --- /dev/null +++ b/external/xamarin-android-tools.override.props @@ -0,0 +1,10 @@ + + + + + + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-8473eeb9/nuget/v3/index.json; + https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-647b468f/nuget/v3/index.json; + + + diff --git a/src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj b/src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj index aa8694c7a3c..dca5c11d629 100644 --- a/src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj +++ b/src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj @@ -7,7 +7,7 @@ $(MicrosoftAndroidSdkOutDir) - + diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.cs.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.cs.json index 96b6c6bace5..209e3191423 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.cs.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.cs.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Šablona aktivity Androidu", "description": "Třída aktivity Androidu", - "symbols/namespace/description": "obor názvů pro vygenerovaný kód" + "symbols/namespace/description": "obor názvů pro vygenerovaný kód", + "postActions/openInEditor/description": "Otevře soubor Activity1.cs v editoru" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.de.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.de.json index 9ab59500642..054d3423f73 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.de.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.de.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android-Aktivitätsvorlage", "description": "Eine Android-Aktivitätsklasse", - "symbols/namespace/description": "Namespace für den generierten Code" + "symbols/namespace/description": "Namespace für den generierten Code", + "postActions/openInEditor/description": "Öffnet Activity1.cs im Editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.en.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.en.json index 49e602ae83c..66a04db062c 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.en.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.en.json @@ -1,6 +1,7 @@ -{ - "author": "Microsoft", - "name": "Android Activity template", - "description": "An Android Activity class", - "symbols/namespace/description": "namespace for the generated code" +{ + "author": "Microsoft", + "name": "Android Activity template", + "description": "An Android Activity class", + "symbols/namespace/description": "namespace for the generated code", + "postActions/openInEditor/description": "Opens Activity1.cs in the editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.es.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.es.json index c2c4b99609a..a2b0fdd88b3 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.es.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.es.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Plantilla de actividad de Android", "description": "Una clase de actividad de Android", - "symbols/namespace/description": "espacio de nombres para el código generado" + "symbols/namespace/description": "espacio de nombres para el código generado", + "postActions/openInEditor/description": "Abre Activity1.cs en el editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.fr.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.fr.json index d39d18bdcc1..7384adafecb 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.fr.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.fr.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Modèle d’activité Android", "description": "Une classe d’activité Android", - "symbols/namespace/description": "espace de noms pour le code généré" + "symbols/namespace/description": "espace de noms pour le code généré", + "postActions/openInEditor/description": "Ouvre Activity1.cs dans l’éditeur" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.it.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.it.json index c21590dc729..6f449315d1f 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.it.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.it.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Modello di attività Android", "description": "Classe di attività Android", - "symbols/namespace/description": "spazio dei nomi per il codice generato" + "symbols/namespace/description": "spazio dei nomi per il codice generato", + "postActions/openInEditor/description": "Apre Activity1.cs nell'editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ja.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ja.json index 040ce9e560a..58eca70a69b 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ja.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ja.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android アクティビティ テンプレート", "description": "Android アクティビティ クラス", - "symbols/namespace/description": "生成されたコードの名前空間" + "symbols/namespace/description": "生成されたコードの名前空間", + "postActions/openInEditor/description": "エディターで Activity1.cs を開きます" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ko.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ko.json index 4b7836a4823..3fb98e6fa19 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ko.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ko.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android 활동 템플릿", "description": "Android 활동 클래스", - "symbols/namespace/description": "생성된 코드의 네임스페이스" + "symbols/namespace/description": "생성된 코드의 네임스페이스", + "postActions/openInEditor/description": "편집기에서 Activity1.cs를 엽니다." } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pl.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pl.json index f786efc3b6c..b79c2185192 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pl.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pl.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Szablon Aktywność systemu Android", "description": "Klasa Aktywność systemu Android", - "symbols/namespace/description": "przestrzeń nazw wygenerowanego kodu." + "symbols/namespace/description": "przestrzeń nazw wygenerowanego kodu.", + "postActions/openInEditor/description": "Otwiera plik Activity1.cs w edytorze" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pt-BR.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pt-BR.json index b24983ffa21..a3050741c5a 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pt-BR.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.pt-BR.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Modelo de Atividade do Android", "description": "Uma classe de Atividade do Android", - "symbols/namespace/description": "namespace do código gerado" + "symbols/namespace/description": "namespace do código gerado", + "postActions/openInEditor/description": "Abre Activity1.cs no editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ru.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ru.json index 816867363e4..feacd4ee7f1 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ru.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.ru.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Шаблон действий Android", "description": "Класс активности Android", - "symbols/namespace/description": "пространство имен для созданного кода" + "symbols/namespace/description": "пространство имен для созданного кода", + "postActions/openInEditor/description": "Открывает Activity1.cs в редакторе" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.tr.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.tr.json index 28816a8a679..ccbe7a76c6d 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.tr.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.tr.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android Etkinlik şablonu", "description": "Android Etkinlik sınıfı", - "symbols/namespace/description": "oluşturulan kod için ad alanı" + "symbols/namespace/description": "oluşturulan kod için ad alanı", + "postActions/openInEditor/description": "Activity1.cs dosyasını düzenleyicide açar" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hans.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hans.json index c1869379ee6..7e9e2fb2073 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hans.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hans.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android 活动模板", "description": "Android 活动类", - "symbols/namespace/description": "生成的代码的命名空间" + "symbols/namespace/description": "生成的代码的命名空间", + "postActions/openInEditor/description": "在编辑器中打开 Activity1.cs" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hant.json b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hant.json index 3ff5e84fc93..a7501e3e863 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hant.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/localize/templatestrings.zh-Hant.json @@ -2,5 +2,6 @@ "author": "Microsoft", "name": "Android 活動範本", "description": "Android 活動類別", - "symbols/namespace/description": "適用於產生之程式碼的命名空間" + "symbols/namespace/description": "適用於產生之程式碼的命名空間", + "postActions/openInEditor/description": "在編輯器中開啟 Activity1.cs" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-activity/.template.config/template.json b/src/Microsoft.Android.Templates/android-activity/.template.config/template.json index b729622d9c3..be928b8a921 100644 --- a/src/Microsoft.Android.Templates/android-activity/.template.config/template.json +++ b/src/Microsoft.Android.Templates/android-activity/.template.config/template.json @@ -21,5 +21,18 @@ "replaces": "AndroidApp1", "type": "parameter" } - } + }, + "postActions": [ + { + "id": "openInEditor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens Activity1.cs in the editor", + "manualInstructions": [], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "0" + }, + "continueOnError": true + } + ] } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.cs.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.cs.json index 19468f6c06b..98469f9b720 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.cs.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.cs.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Šablona rozložení pro Android", - "description": "Soubor rozložení Androidu (XML)" + "description": "Soubor rozložení Androidu (XML)", + "postActions/openInEditor/description": "Otevře soubor Layout1.xml v editoru" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.de.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.de.json index 9efa2e625d4..7082b64b9ef 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.de.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.de.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android-Layoutvorlage", - "description": "Eine Android-Layoutdatei (XML)" + "description": "Eine Android-Layoutdatei (XML)", + "postActions/openInEditor/description": "Öffnet Layout1.xml im Editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.en.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.en.json index 576c1260aa9..97dd8ac01e3 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.en.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.en.json @@ -1,5 +1,6 @@ -{ - "author": "Microsoft", - "name": "Android Layout template", - "description": "An Android layout (XML) file" +{ + "author": "Microsoft", + "name": "Android Layout template", + "description": "An Android layout (XML) file", + "postActions/openInEditor/description": "Opens Layout1.xml in the editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.es.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.es.json index a4ba036b699..6f69c4da7a9 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.es.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.es.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Plantilla de diseño de Android", - "description": "Un archivo de diseño de Android (XML)" + "description": "Un archivo de diseño de Android (XML)", + "postActions/openInEditor/description": "Abre Layout1.xml en el editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.fr.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.fr.json index 0510754c32f..d4f92089e84 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.fr.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.fr.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Modèle de disposition Android", - "description": "Fichier de disposition Android (XML)" + "description": "Fichier de disposition Android (XML)", + "postActions/openInEditor/description": "Ouvre Layout1.xml dans l’éditeur" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.it.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.it.json index 6312b8fe267..40c52301a2b 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.it.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.it.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Modello di layout Android", - "description": "File di layout Android (XML)" + "description": "File di layout Android (XML)", + "postActions/openInEditor/description": "Apre Layout1.xml nell'editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ja.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ja.json index 88961b84322..4f0ab4f5fbc 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ja.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ja.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android レイアウト テンプレート", - "description": "Android レイアウト (XML) ファイル" + "description": "Android レイアウト (XML) ファイル", + "postActions/openInEditor/description": "エディターで Layout1.xml を開きます" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ko.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ko.json index b3453aea66d..3766f60e2fc 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ko.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ko.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android 레이아웃 템플릿", - "description": "Android 레이아웃(XML) 파일" + "description": "Android 레이아웃(XML) 파일", + "postActions/openInEditor/description": "편집기에서 Layout1.xml 엽니다." } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pl.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pl.json index d3d13274490..0421f11b109 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pl.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pl.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Szablon Układ systemu Android", - "description": "Plik układu systemu Android (XML)" + "description": "Plik układu systemu Android (XML)", + "postActions/openInEditor/description": "Otwiera plik Layout1.xml w edytorze" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pt-BR.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pt-BR.json index 2352aa236ca..43039dbe9a4 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pt-BR.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.pt-BR.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Modelo de Layout do Android", - "description": "Um arquivo de layout do Android (XML)" + "description": "Um arquivo de layout do Android (XML)", + "postActions/openInEditor/description": "Abre Layout1.xml no editor" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ru.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ru.json index 1649b2f1dfa..46f7d0395a3 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ru.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.ru.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Шаблон макета Android", - "description": "Файл макета Android (XML)" + "description": "Файл макета Android (XML)", + "postActions/openInEditor/description": "Открывает Layout1.xml в редакторе" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.tr.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.tr.json index 9106f4a1483..d42375f3fe5 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.tr.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.tr.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android Düzeni şablonu", - "description": "Android düzeni (XML) dosyası" + "description": "Android düzeni (XML) dosyası", + "postActions/openInEditor/description": "Layout1.xml dosyasını düzenleyicide açar" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hans.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hans.json index c7fb9a8681b..f1e39eb23c9 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hans.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hans.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android 布局模板", - "description": "Android 布局 (XML) 文件" + "description": "Android 布局 (XML) 文件", + "postActions/openInEditor/description": "在编辑器中打开 Layout1.xml" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hant.json b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hant.json index 4d4caa80e3e..54370db861f 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hant.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/localize/templatestrings.zh-Hant.json @@ -1,5 +1,6 @@ { "author": "Microsoft", "name": "Android 版面配置範本", - "description": "Android 配置 (XML) 檔案" + "description": "Android 配置 (XML) 檔案", + "postActions/openInEditor/description": "在編輯器中開啟 Layout1.xml" } \ No newline at end of file diff --git a/src/Microsoft.Android.Templates/android-layout/.template.config/template.json b/src/Microsoft.Android.Templates/android-layout/.template.config/template.json index 2d1d8c72fb7..c3cea066474 100644 --- a/src/Microsoft.Android.Templates/android-layout/.template.config/template.json +++ b/src/Microsoft.Android.Templates/android-layout/.template.config/template.json @@ -14,5 +14,18 @@ "primaryOutputs": [ { "path": "Layout1.xml" } ], - "defaultName": "Layout1" + "defaultName": "Layout1", + "postActions": [ + { + "id": "openInEditor", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens Layout1.xml in the editor", + "manualInstructions": [], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "0" + }, + "continueOnError": true + } + ] } \ No newline at end of file diff --git a/src/Mono.Android/Android.App/Activity.cs b/src/Mono.Android/Android.App/Activity.cs index 87f30d8a254..a8156ec04c6 100644 --- a/src/Mono.Android/Android.App/Activity.cs +++ b/src/Mono.Android/Android.App/Activity.cs @@ -12,7 +12,6 @@ partial class Activity { return this.FindViewById (id)!.JavaCast (); } -#if NET7_0_OR_GREATER || (NET6_0_OR_GREATER && ANDROID_33) || ANDROID_34 // See: https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/app/Activity.java;l=3430 public T RequireViewById (int id) where T : Android.Views.View @@ -23,7 +22,6 @@ public T RequireViewById (int id) } return view; } -#endif // NET7_0_OR_GREATER || (NET6_0_OR_GREATER && ANDROID_33) || ANDROID_34 public void StartActivityForResult (Type activityType, int requestCode) { diff --git a/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs b/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs index f81a0b5c0bc..edfe42ec449 100644 --- a/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs +++ b/src/Mono.Android/Android.Runtime/AndroidEnvironment.cs @@ -332,9 +332,7 @@ static IWebProxy GetDefaultProxy () // This is invoked by // System.Net.Http.dll!System.Net.Http.HttpClient.cctor // DO NOT REMOVE -#if !MONOANDROID1_0 [DynamicDependency (DynamicallyAccessedMemberTypes.PublicParameterlessConstructor, typeof (Xamarin.Android.Net.AndroidMessageHandler))] -#endif static object GetHttpMessageHandler () { if (httpMessageHandlerType is null) { @@ -357,14 +355,12 @@ static object GetHttpMessageHandler () static bool IsAcceptableHttpMessageHandlerType (Type handlerType) { -#if !MONOANDROID1_0 if (Extends (handlerType, "System.Net.Http.HttpClientHandler, System.Net.Http")) { // It's not possible to construct HttpClientHandler in this method because it would cause infinite recursion // as HttpClientHandler's constructor calls the GetHttpMessageHandler function Logger.Log (LogLevel.Warn, "MonoAndroid", $"The type {handlerType.AssemblyQualifiedName} cannot be used as the native HTTP handler because it is derived from System.Net.Htt.HttpClientHandler. Use a type that extends System.Net.Http.HttpMessageHandler instead."); return false; } -#endif if (!Extends (handlerType, "System.Net.Http.HttpMessageHandler, System.Net.Http")) { Logger.Log (LogLevel.Warn, "MonoAndroid", $"The type {handlerType.AssemblyQualifiedName} set as the default HTTP handler is invalid. Use a type that extends System.Net.Http.HttpMessageHandler."); return false; diff --git a/src/Mono.Android/Android.Runtime/AndroidRuntime.cs b/src/Mono.Android/Android.Runtime/AndroidRuntime.cs index 9e67d00721c..cd815b76391 100644 --- a/src/Mono.Android/Android.Runtime/AndroidRuntime.cs +++ b/src/Mono.Android/Android.Runtime/AndroidRuntime.cs @@ -33,11 +33,9 @@ internal AndroidRuntime (IntPtr jnienv, classLoader_loadClass, jniAddNativeMethodRegistrationAttributePresent)) { -#if NETCOREAPP // This is not ideal, but we need to set this while the runtime is initializing but we can't do it directly from the `JNIEnvInit.Initialize` method, since // it lives in an assembly that does not reference Mono.Android. So we do it here, because this class is instantiated by JNIEnvInit.Initialize. AndroidEnvironmentInternal.UnhandledExceptionHandler = AndroidEnvironment.UnhandledException; -#endif } public override void FailFast (string? message) @@ -268,11 +266,7 @@ protected override IEnumerable GetTypesForSimpleReference (string jniSimpl { string? j = JNIEnv.TypemapManagedToJava (type); if (j != null) { - return -#if NET - GetReplacementTypeCore (j) ?? -#endif // NET - j; + return GetReplacementTypeCore (j) ?? j; } if (JNIEnvInit.IsRunningOnDesktop) { return JavaNativeTypeManager.ToJniName (type); @@ -283,9 +277,8 @@ protected override IEnumerable GetTypesForSimpleReference (string jniSimpl protected override IEnumerable GetSimpleReferences (Type type) { string? j = JNIEnv.TypemapManagedToJava (type); -#if NET j = GetReplacementTypeCore (j) ?? j; -#endif // NET + if (JNIEnvInit.IsRunningOnDesktop) { string? d = JavaNativeTypeManager.ToJniName (type); if (j != null && d != null) { @@ -301,7 +294,6 @@ protected override IEnumerable GetSimpleReferences (Type type) return Array.Empty (); } -#if NET protected override IReadOnlyList? GetStaticMethodFallbackTypesCore (string jniSimpleReference) { ReadOnlySpan name = jniSimpleReference; @@ -383,7 +375,6 @@ protected override IEnumerable GetSimpleReferences (Type type) TargetJniMethodInstanceToStatic = method.is_static, }; } -#endif // NET delegate Delegate GetCallbackHandler (); diff --git a/src/Mono.Android/Android.Runtime/AndroidRuntimeInternal.cs b/src/Mono.Android/Android.Runtime/AndroidRuntimeInternal.cs index 37df6ef353a..baaf3d9b32e 100644 --- a/src/Mono.Android/Android.Runtime/AndroidRuntimeInternal.cs +++ b/src/Mono.Android/Android.Runtime/AndroidRuntimeInternal.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#if INSIDE_MONO_ANDROID_RUNTIME using System; using System.Reflection; @@ -7,11 +7,7 @@ namespace Android.Runtime public static class AndroidRuntimeInternal { internal static MethodInfo? mono_unhandled_exception_method = null; -#if NETCOREAPP internal static Action mono_unhandled_exception = RuntimeNativeMethods.monodroid_debugger_unhandled_exception; -#else - internal static Action? mono_unhandled_exception = null; -#endif #pragma warning disable CS0649 // Field is never assigned to. This field is assigned from monodroid-glue.cc. internal static volatile bool BridgeProcessing; // = false @@ -38,4 +34,4 @@ public static void WaitForBridgeProcessing () } } } -#endif // !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#endif // INSIDE_MONO_ANDROID_RUNTIME diff --git a/src/Mono.Android/Android.Runtime/JNIEnv.cs b/src/Mono.Android/Android.Runtime/JNIEnv.cs index 3250cbb67ae..cbb7f3a53d4 100644 --- a/src/Mono.Android/Android.Runtime/JNIEnv.cs +++ b/src/Mono.Android/Android.Runtime/JNIEnv.cs @@ -103,27 +103,9 @@ static void ManualJavaObjectDispose (Java.Lang.Object obj) GC.SuppressFinalize (obj); } -#if !NETCOREAPP - static Action AppDomain_DoUnhandledException = null!; -#endif // ndef NETCOREAPP - static void Initialize () { AndroidRuntimeInternal.InitializeUnhandledExceptionMethod (); -#if !NETCOREAPP - if (AppDomain_DoUnhandledException == null) { - var ad_due = typeof (AppDomain) - .GetMethod ("DoUnhandledException", - bindingAttr: BindingFlags.NonPublic | BindingFlags.Instance, - binder: null, - types: new []{typeof (UnhandledExceptionEventArgs)}, - modifiers: null); - if (ad_due != null) { - AppDomain_DoUnhandledException = (Action) Delegate.CreateDelegate ( - typeof (Action), ad_due); - } - } -#endif // ndef NETCOREAPP } internal static void PropagateUncaughtException (IntPtr env, IntPtr javaThreadPtr, IntPtr javaExceptionPtr) @@ -150,14 +132,7 @@ internal static void PropagateUncaughtException (IntPtr env, IntPtr javaThreadPt Logger.Log (LogLevel.Info, "MonoDroid", "UNHANDLED EXCEPTION:"); Logger.Log (LogLevel.Info, "MonoDroid", javaException.ToString ()); -#if !NETCOREAPP - var args = new UnhandledExceptionEventArgs (innerException ?? javaException, isTerminating: true); - // Disabled until Linker error surfaced in https://github.com/xamarin/xamarin-android/pull/4302#issuecomment-596400025 is resolved - //AppDomain.CurrentDomain.DoUnhandledException (args); - AppDomain_DoUnhandledException?.Invoke (AppDomain.CurrentDomain, args); -#else // ndef NETCOREAPP RuntimeNativeMethods.monodroid_unhandled_exception (innerException ?? javaException); -#endif // def NETCOREAPP } catch (Exception e) { Logger.Log (LogLevel.Error, "monodroid", "Exception thrown while raising AppDomain.UnhandledException event: " + e.ToString ()); } diff --git a/src/Mono.Android/Android.Runtime/JNIEnvInit.cs b/src/Mono.Android/Android.Runtime/JNIEnvInit.cs index 9311757806e..2f65464716b 100644 --- a/src/Mono.Android/Android.Runtime/JNIEnvInit.cs +++ b/src/Mono.Android/Android.Runtime/JNIEnvInit.cs @@ -51,9 +51,7 @@ internal struct JnienvInitializeArgs { static AndroidRuntime? androidRuntime; -#if NETCOREAPP [UnmanagedCallersOnly] -#endif static unsafe void RegisterJniNatives (IntPtr typeName_ptr, int typeName_len, IntPtr jniClass, IntPtr methods_ptr, int methods_len) { string typeName = new string ((char*) typeName_ptr, 0, typeName_len); @@ -75,9 +73,7 @@ static unsafe void RegisterJniNatives (IntPtr typeName_ptr, int typeName_len, In ((AndroidTypeManager)androidRuntime!.TypeManager).RegisterNativeMembers (jniType, type, methods); } -#if NETCOREAPP [UnmanagedCallersOnly] -#endif internal static unsafe void Initialize (JnienvInitializeArgs* args) { IntPtr total_timing_sequence = IntPtr.Zero; @@ -88,19 +84,13 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args) gref_gc_threshold = args->grefGcThreshold; jniRemappingInUse = args->jniRemappingInUse; -#if NETCOREAPP MarshalMethodsEnabled = args->marshalMethodsEnabled; -#endif java_class_loader = args->grefLoader; mid_Class_forName = new JniMethodInfo (args->Class_forName, isStatic: true); LocalRefsAreIndirect = args->localRefsAreIndirect == 1; -#if MONOANDROID1_0 - Mono.SystemDependencyProvider.Initialize (); -#endif - bool androidNewerThan10 = args->androidSdkVersion > 10; BoundExceptionType = (BoundExceptionType)args->ioExceptionType; androidRuntime = new AndroidRuntime (args->env, args->javaVm, androidNewerThan10, args->grefLoader, args->Loader_loadClass, args->jniAddNativeMethodRegistrationAttributePresent != 0); @@ -121,16 +111,12 @@ internal static unsafe void Initialize (JnienvInitializeArgs* args) } } -#if !MONOANDROID1_0 SetSynchronizationContext (); -#endif } -#if !MONOANDROID1_0 // NOTE: prevents Android.App.Application static ctor from running [MethodImpl (MethodImplOptions.NoInlining)] static void SetSynchronizationContext () => SynchronizationContext.SetSynchronizationContext (Android.App.Application.SynchronizationContext); -#endif } } diff --git a/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs b/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs index ddbc3ef2e0b..a61045740d2 100644 --- a/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs +++ b/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs @@ -9,11 +9,7 @@ public static partial class JNINativeWrapper static bool _unhandled_exception (Exception e) { if (Debugger.IsAttached || !JNIEnvInit.PropagateExceptions) { -#if NETCOREAPP AndroidRuntimeInternal.mono_unhandled_exception?.Invoke (e); -#else - JNIEnvInit.mono_unhandled_exception?.Invoke (e); -#endif return false; } return true; diff --git a/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.tt b/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.tt index 431d826c739..aef57c6278d 100644 --- a/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.tt +++ b/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.tt @@ -257,11 +257,7 @@ namespace Android.Runtime static bool _unhandled_exception (Exception e) { if (Debugger.IsAttached || !JNIEnvInit.PropagateExceptions) { -#if NETCOREAPP AndroidRuntimeInternal.mono_unhandled_exception?.Invoke (e); -#else - JNIEnvInit.mono_unhandled_exception?.Invoke (e); -#endif return false; } return true; diff --git a/src/Mono.Android/Android.Runtime/LogCategories.cs b/src/Mono.Android/Android.Runtime/LogCategories.cs index 5eb6020cfad..f33fd0d1a18 100644 --- a/src/Mono.Android/Android.Runtime/LogCategories.cs +++ b/src/Mono.Android/Android.Runtime/LogCategories.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#if INSIDE_MONO_ANDROID_RUNTIME using System; namespace Android.Runtime @@ -20,4 +20,4 @@ internal enum LogCategories { Netlink = 1 << 9, } } -#endif // !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#endif // INSIDE_MONO_ANDROID_RUNTIME diff --git a/src/Mono.Android/Android.Runtime/LogLevel.cs b/src/Mono.Android/Android.Runtime/LogLevel.cs index 347f2037523..52254f7dab6 100644 --- a/src/Mono.Android/Android.Runtime/LogLevel.cs +++ b/src/Mono.Android/Android.Runtime/LogLevel.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#if INSIDE_MONO_ANDROID_RUNTIME namespace Android.Runtime { // Keep in sync with the LogLevel enum in @@ -15,4 +15,4 @@ internal enum LogLevel { Silent = 0x08 } } -#endif // !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#endif // INSIDE_MONO_ANDROID_RUNTIME diff --git a/src/Mono.Android/Android.Runtime/PreserveAttribute.cs b/src/Mono.Android/Android.Runtime/PreserveAttribute.cs index b8646d3fd4d..c45be56db15 100644 --- a/src/Mono.Android/Android.Runtime/PreserveAttribute.cs +++ b/src/Mono.Android/Android.Runtime/PreserveAttribute.cs @@ -32,9 +32,7 @@ namespace Android.Runtime { -#if NETCOREAPP [Obsolete ("Please use [System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute]")] -#endif // NETCOREAPP [AttributeUsage ( AttributeTargets.Class | AttributeTargets.Struct diff --git a/src/Mono.Android/Android.Runtime/RuntimeConstants.cs b/src/Mono.Android/Android.Runtime/RuntimeConstants.cs index 254fb8c2170..8d9d0557579 100644 --- a/src/Mono.Android/Android.Runtime/RuntimeConstants.cs +++ b/src/Mono.Android/Android.Runtime/RuntimeConstants.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#if INSIDE_MONO_ANDROID_RUNTIME namespace Android.Runtime { internal static class RuntimeConstants @@ -6,4 +6,4 @@ internal static class RuntimeConstants public const string InternalDllName = "xa-internal-api"; } } -#endif // !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#endif // INSIDE_MONO_ANDROID_RUNTIME diff --git a/src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs b/src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs index 3487514a6a7..a0c936c59ff 100644 --- a/src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs +++ b/src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs @@ -1,4 +1,4 @@ -#if !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#if INSIDE_MONO_ANDROID_RUNTIME using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -76,13 +76,12 @@ internal static class RuntimeNativeMethods [DllImport (RuntimeConstants.InternalDllName, CallingConvention = CallingConvention.Cdecl)] internal static extern int _monodroid_max_gref_get (); -#if NETCOREAPP + [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void monodroid_unhandled_exception (Exception javaException); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern unsafe void monodroid_debugger_unhandled_exception (Exception e); -#endif } } -#endif // !NETCOREAPP || INSIDE_MONO_ANDROID_RUNTIME +#endif // INSIDE_MONO_ANDROID_RUNTIME diff --git a/src/Mono.Android/Android.Views/View.cs b/src/Mono.Android/Android.Views/View.cs index ef5fe5739ee..2a17143e167 100644 --- a/src/Mono.Android/Android.Views/View.cs +++ b/src/Mono.Android/Android.Views/View.cs @@ -28,7 +28,6 @@ public bool PerformAccessibilityAction (GlobalAction action, Bundle arguments) return this.FindViewById (id).JavaCast (); } -#if NET7_0_OR_GREATER || (NET6_0_OR_GREATER && ANDROID_33) || ANDROID_34 // See: https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/view/View.java;l=25322 public T RequireViewById (int id) where T : Android.Views.View @@ -39,7 +38,6 @@ public T RequireViewById (int id) } return view; } -#endif //NET7_0_OR_GREATER || (NET6_0_OR_GREATER && ANDROID_33) || ANDROID_34 public bool Post (Action action) { @@ -91,7 +89,7 @@ public bool FitsSystemWindows () } #endif -#if NET && ANDROID_34 +#if ANDROID_34 [global::System.Runtime.Versioning.ObsoletedOSPlatform ("android30.0", "These flags are deprecated. Use WindowInsetsController instead.")] public SystemUiFlags SystemUiFlags { get => (SystemUiFlags) SystemUiVisibility; diff --git a/src/Mono.Android/Android.Views/WindowManagerLayoutParams.cs b/src/Mono.Android/Android.Views/WindowManagerLayoutParams.cs index cd1882a2998..57cb12c9989 100644 --- a/src/Mono.Android/Android.Views/WindowManagerLayoutParams.cs +++ b/src/Mono.Android/Android.Views/WindowManagerLayoutParams.cs @@ -4,7 +4,7 @@ namespace Android.Views { partial class WindowManagerLayoutParams { -#if NET && ANDROID_34 +#if ANDROID_34 [global::System.Runtime.Versioning.ObsoletedOSPlatform ("android30.0", "These flags are deprecated. Use WindowInsetsController instead.")] public SystemUiFlags SystemUiFlags { get => (SystemUiFlags) SystemUiVisibility; diff --git a/src/Mono.Android/Android/LinkerSafeAttribute.cs b/src/Mono.Android/Android/LinkerSafeAttribute.cs index b44a07a6821..0709b8e161f 100644 --- a/src/Mono.Android/Android/LinkerSafeAttribute.cs +++ b/src/Mono.Android/Android/LinkerSafeAttribute.cs @@ -2,9 +2,7 @@ namespace Android { -#if NETCOREAPP [Obsolete ("For .NET 6+, please use: [assembly: global::System.Reflection.AssemblyMetadata(\"IsTrimmable\", \"True\")]")] -#endif // NETCOREAPP [AttributeUsage (AttributeTargets.Assembly)] public sealed class LinkerSafeAttribute : Attribute { diff --git a/src/Mono.Android/Java.Interop/JavaTypeParametersAttribute.cs b/src/Mono.Android/Java.Interop/JavaTypeParametersAttribute.cs index b7f8c38f2c8..a0e6aa36143 100644 --- a/src/Mono.Android/Java.Interop/JavaTypeParametersAttribute.cs +++ b/src/Mono.Android/Java.Interop/JavaTypeParametersAttribute.cs @@ -1,26 +1,8 @@ using System; -#if NET using System.Runtime.CompilerServices; // PublicApiAnalyzers doesn't like TypeForwards #pragma warning disable RS0016 // Symbol is not part of the declared API [assembly: TypeForwardedTo (typeof (Java.Interop.JavaTypeParametersAttribute))] #pragma warning restore RS0016 // Symbol is not part of the declared API - -#else // !NET - -namespace Java.Interop -{ - public class JavaTypeParametersAttribute : Attribute - { - public JavaTypeParametersAttribute (string [] typeParameters) - { - TypeParameters = typeParameters; - } - - public string [] TypeParameters { get; set; } - } -} - -#endif // !NET diff --git a/src/Mono.Android/Java.Interop/TypeManager.cs b/src/Mono.Android/Java.Interop/TypeManager.cs index 637a1789e4e..3b900017db2 100644 --- a/src/Mono.Android/Java.Interop/TypeManager.cs +++ b/src/Mono.Android/Java.Interop/TypeManager.cs @@ -420,7 +420,6 @@ static void n_Activate (IntPtr jnienv, IntPtr jclass, IntPtr typename_ptr, IntPt TypeManager.n_Activate (jnienv, jclass, typename_ptr, signature_ptr, jobject, parameters_ptr); } -#if NETCOREAPP [UnmanagedCallersOnly] static void n_Activate_mm (IntPtr jnienv, IntPtr jclass, IntPtr typename_ptr, IntPtr signature_ptr, IntPtr jobject, IntPtr parameters_ptr) { @@ -431,7 +430,7 @@ static void n_Activate_mm (IntPtr jnienv, IntPtr jclass, IntPtr typename_ptr, In AndroidEnvironment.UnhandledException (ex); } } -#endif + internal static Delegate GetActivateHandler () { return TypeManager.GetActivateHandler (); diff --git a/src/Mono.Android/Mono.Android.targets b/src/Mono.Android/Mono.Android.targets index 9c0388fe7ba..0b7944d3f61 100644 --- a/src/Mono.Android/Mono.Android.targets +++ b/src/Mono.Android/Mono.Android.targets @@ -238,9 +238,9 @@ - 33 - 33 - xamarin-android-sdk-13 + 34 + $(DocsApiLevel) + net-android-$(DocsApiLevel).0 <_LogPrefix>$(MSBuildThisFileDirectory)../../bin/Build$(Configuration)/UpdateApiDocs-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss")) <_Mdoc Condition=" '$(Pkgmdoc)' != '' ">"$(Pkgmdoc)/tools/mdoc.exe" <_Mdoc Condition=" '$(Pkgmdoc)' == '' ">"$(XAPackagesDir)/mdoc/$(MdocPackageVersion)/tools/mdoc.exe" diff --git a/src/Mono.Android/Properties/AssemblyInfo.cs.in b/src/Mono.Android/Properties/AssemblyInfo.cs.in index 61759dd9c6c..100a54ae5c6 100644 --- a/src/Mono.Android/Properties/AssemblyInfo.cs.in +++ b/src/Mono.Android/Properties/AssemblyInfo.cs.in @@ -22,10 +22,8 @@ using System.Runtime.Versioning; #if ANDROID_UNSTABLE [assembly: RequiresPreviewFeatures("This is an unstable Android API level. Opt into preview features by adding True to your project file.")] #endif -#if !MONOANDROID1_0 [assembly: TargetPlatform("Android@API_LEVEL@.0")] [assembly: SupportedOSPlatform("Android@MIN_API_LEVEL@.0")] -#endif // PublicApiAnalyzers doesn't like TypeForwards #pragma warning disable RS0016 // Symbol is not part of the declared API diff --git a/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs b/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs index 72e38a63100..7afa2db0f5f 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AndroidHttpResponseMessage.cs @@ -6,13 +6,8 @@ namespace Xamarin.Android.Net { /// -#if MONOANDROID1_0 - /// A convenience wrapper around returned by - /// that allows easy access to authentication data as returned by the server, if any. -#else /// A convenience wrapper around returned by /// that allows easy access to authentication data as returned by the server, if any. -#endif /// public class AndroidHttpResponseMessage : HttpResponseMessage { @@ -20,21 +15,13 @@ public class AndroidHttpResponseMessage : HttpResponseMessage HttpURLConnection? httpConnection; /// -#if MONOANDROID1_0 - /// Set to the same value as . -#else /// Set to the same value as . -#endif /// /// The requested authentication. public IList ? RequestedAuthentication { get; internal set; } /// -#if MONOANDROID1_0 - /// Set to the same value as -#else /// Set to the same value as -#endif /// /// The request needs authorization. public bool RequestNeedsAuthorization { diff --git a/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs b/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs index 6804db9ced1..e5218687ae7 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AndroidMessageHandler.cs @@ -40,6 +40,7 @@ namespace Xamarin.Android.Net /// /// var httpClient = new HttpClient (handler); /// var response = httpClient.GetAsync ("http://example.com")?.Result as AndroidHttpResponseMessage; + /// /// /// The class supports pre-authentication of requests albeit in a slightly "manual" way. Namely, whenever a request to a server requiring authentication /// is made and no authentication credentials are provided in the property (which is usually the case on the first @@ -137,12 +138,14 @@ public void Reset () DecompressionMethods _decompressionMethods; bool disposed; + bool started; // Now all hail Java developers! Get this... HttpURLClient defaults to accepting AND // uncompressing the gzip content encoding UNLESS you set the Accept-Encoding header to ANY // value. So if we set it to 'gzip' below we WILL get gzipped stream but HttpURLClient will NOT // uncompress it any longer, doh. And they don't support 'deflate' so we need to handle it ourselves. - bool decompress_here; + bool decompress_here => _acceptEncoding is not null && _acceptEncoding != IDENTITY_ENCODING; + string? _acceptEncoding; public bool SupportsAutomaticDecompression => true; public bool SupportsProxy => true; @@ -151,7 +154,29 @@ public void Reset () public DecompressionMethods AutomaticDecompression { get => _decompressionMethods; - set => _decompressionMethods = value; + set + { + CheckDisposedOrStarted (); + + _decompressionMethods = value; + _acceptEncoding = null; + + if (value == DecompressionMethods.None) { + _acceptEncoding = IDENTITY_ENCODING; + } else { + if ((value & DecompressionMethods.GZip) != 0) { + _acceptEncoding = GZIP_ENCODING; + } + + if ((value & DecompressionMethods.Deflate) != 0) { + _acceptEncoding = _acceptEncoding is null ? DEFLATE_ENCODING : $"{_acceptEncoding}, {DEFLATE_ENCODING}"; + } + + if ((value & DecompressionMethods.Brotli) != 0) { + _acceptEncoding = _acceptEncoding is null ? BROTLI_ENCODING : $"{_acceptEncoding}, {BROTLI_ENCODING}"; + } + } + } } public CookieContainer CookieContainer @@ -269,9 +294,7 @@ public int MaxAutomaticRedirections /// If true then the server requested authorization and the application must use information /// found in to set the value of /// -#if NETCOREAPP [MemberNotNullWhen(true, nameof(RequestedAuthentication))] -#endif public bool RequestNeedsAuthorization { get { return RequestedAuthentication?.Count > 0; } } @@ -309,7 +332,6 @@ public bool RequestNeedsAuthorization { /// public TimeSpan ReadTimeout { get; set; } = TimeSpan.FromHours (24); -#if !MONOANDROID1_0 /// /// A feature switch that determines whether the message handler should attempt to authenticate the user /// using the NTLM/Negotiate authentication method. Enable the feature by adding @@ -317,7 +339,6 @@ public bool RequestNeedsAuthorization { /// static bool NegotiateAuthenticationIsEnabled => AppContext.TryGetSwitch ("Xamarin.Android.Net.UseNegotiateAuthentication", out bool isEnabled) && isEnabled; -#endif /// /// @@ -337,7 +358,7 @@ public bool RequestNeedsAuthorization { protected override void Dispose (bool disposing) { - disposed = true; + disposed = true; base.Dispose (disposing); } @@ -349,6 +370,14 @@ protected void AssertSelf () throw new ObjectDisposedException (nameof (AndroidMessageHandler)); } + void CheckDisposedOrStarted () + { + AssertSelf (); + if (started) { + throw new InvalidOperationException ("The handler has already started sending requests"); + } + } + string EncodeUrl (Uri url) { if (url == null) @@ -388,16 +417,13 @@ string EncodeUrl (Uri url) /// Cancellation token. protected override Task SendAsync (HttpRequestMessage request, CancellationToken cancellationToken) { -#if !MONOANDROID1_0 if (NegotiateAuthenticationIsEnabled) { return SendWithNegotiateAuthenticationAsync (request, cancellationToken); } -#endif return DoSendAsync (request, cancellationToken); } -#if !MONOANDROID1_0 async Task SendWithNegotiateAuthenticationAsync (HttpRequestMessage request, CancellationToken cancellationToken) { var response = await DoSendAsync (request, cancellationToken).ConfigureAwait (false); @@ -410,10 +436,10 @@ string EncodeUrl (Uri url) return response; } -#endif internal async Task DoSendAsync (HttpRequestMessage request, CancellationToken cancellationToken) { + started = true; AssertSelf (); if (request == null) throw new ArgumentNullException (nameof (request)); @@ -543,30 +569,29 @@ protected virtual async Task WriteRequestContentToOutput (HttpRequestMessage req if (request.Content is null) return; - using (var stream = await request.Content.ReadAsStreamAsync ().ConfigureAwait (false)) { - await stream.CopyToAsync(httpConnection.OutputStream!, 4096, cancellationToken).ConfigureAwait(false); - - // - // Rewind the stream to beginning in case the HttpContent implementation - // will be accessed again (e.g. after redirect) and it keeps its stream - // open behind the scenes instead of recreating it on the next call to - // ReadAsStreamAsync. If we don't rewind it, the ReadAsStreamAsync - // call above will throw an exception as we'd be attempting to read an - // already "closed" stream (that is one whose Position is set to its - // end). - // - // This is not a perfect solution since the HttpContent may do weird - // things in its implementation, but it's better than copying the - // content into a buffer since we have no way of knowing how the data is - // read or generated and also we don't want to keep potentially large - // amounts of data in memory (which would happen if we read the content - // into a byte[] buffer and kept it cached for re-use on redirect). - // - // See https://bugzilla.xamarin.com/show_bug.cgi?id=55477 - // - if (stream.CanSeek) - stream.Seek (0, SeekOrigin.Begin); - } + var stream = await request.Content.ReadAsStreamAsync ().ConfigureAwait (false); + await stream.CopyToAsync(httpConnection.OutputStream!, 4096, cancellationToken).ConfigureAwait(false); + + // + // Rewind the stream to beginning in case the HttpContent implementation + // will be accessed again (e.g. after redirect) and it keeps its stream + // open behind the scenes instead of recreating it on the next call to + // ReadAsStreamAsync. If we don't rewind it, the ReadAsStreamAsync + // call above will throw an exception as we'd be attempting to read an + // already "closed" stream (that is one whose Position is set to its + // end). + // + // This is not a perfect solution since the HttpContent may do weird + // things in its implementation, but it's better than copying the + // content into a buffer since we have no way of knowing how the data is + // read or generated and also we don't want to keep potentially large + // amounts of data in memory (which would happen if we read the content + // into a byte[] buffer and kept it cached for re-use on redirect). + // + // See https://bugzilla.xamarin.com/show_bug.cgi?id=55477 + // + if (stream.CanSeek) + stream.Seek (0, SeekOrigin.Begin); } internal Task WriteRequestContentToOutputInternal (HttpRequestMessage request, HttpURLConnection httpConnection, CancellationToken cancellationToken) @@ -750,13 +775,11 @@ Stream GetDecompressionWrapper (URLConnection httpConnection, Stream inputStream } else if (encodings.Contains (DEFLATE_ENCODING)) { supportedEncoding = DEFLATE_ENCODING; ret = new DeflateStream (inputStream, CompressionMode.Decompress); - } -#if NETCOREAPP - else if (encodings.Contains (BROTLI_ENCODING)) { + } else if (encodings.Contains (BROTLI_ENCODING)) { supportedEncoding = BROTLI_ENCODING; ret = new BrotliStream (inputStream, CompressionMode.Decompress); } -#endif + if (!String.IsNullOrEmpty (supportedEncoding)) { contentState.RemoveContentLengthHeader = true; @@ -1060,15 +1083,6 @@ internal Task SetupRequestInternal (HttpRequestMessage request, HttpURLConnectio internal TrustManagerFactory? ConfigureTrustManagerFactoryInternal (KeyStore? keyStore) => ConfigureTrustManagerFactory (keyStore); - void AppendEncoding (string encoding, ref List ? list) - { - if (list == null) - list = new List (); - if (list.Contains (encoding)) - return; - list.Add (encoding); - } - async Task SetupRequestInternal (HttpRequestMessage request, URLConnection conn) { if (conn == null) @@ -1090,31 +1104,8 @@ void AppendEncoding (string encoding, ref List ? list) AddHeaders (httpConnection, request.Content.Headers); AddHeaders (httpConnection, request.Headers); - List ? accept_encoding = null; - - decompress_here = false; - if (AutomaticDecompression == DecompressionMethods.None) { - AppendEncoding (IDENTITY_ENCODING, ref accept_encoding); // Turns off compression for the Java client - } else { - if ((AutomaticDecompression & DecompressionMethods.GZip) != 0) { - AppendEncoding (GZIP_ENCODING, ref accept_encoding); - decompress_here = true; - } - - if ((AutomaticDecompression & DecompressionMethods.Deflate) != 0) { - AppendEncoding (DEFLATE_ENCODING, ref accept_encoding); - decompress_here = true; - } -#if NETCOREAPP - if ((AutomaticDecompression & DecompressionMethods.Brotli) != 0) { - AppendEncoding (BROTLI_ENCODING, ref accept_encoding); - decompress_here = true; - } -#endif - } - - if (accept_encoding?.Count > 0) - httpConnection.SetRequestProperty ("Accept-Encoding", String.Join (",", accept_encoding)); + if (_acceptEncoding is not null) + httpConnection.SetRequestProperty ("Accept-Encoding", _acceptEncoding); if (UseCookies && CookieContainer != null && request.RequestUri is not null) { string cookieHeaderValue = CookieContainer.GetCookieHeader (request.RequestUri); @@ -1159,15 +1150,6 @@ void SetupSSL (HttpsURLConnection? httpsConnection, HttpRequestMessage requestMe return; } -#if MONOANDROID1_0 - // Context: https://github.com/xamarin/xamarin-android/issues/1615 - int apiLevel = (int)Build.VERSION.SdkInt; - if (apiLevel >= 16 && apiLevel <= 20) { - httpsConnection.SSLSocketFactory = new OldAndroidSSLSocketFactory (); - return; - } -#endif - var keyStore = InitializeKeyStore (out bool gotCerts); keyStore = ConfigureKeyStore (keyStore); var kmf = ConfigureKeyManagerFactory (keyStore); diff --git a/src/Mono.Android/Xamarin.Android.Net/AuthModuleDigest.cs b/src/Mono.Android/Xamarin.Android.Net/AuthModuleDigest.cs index a226e3bdd99..7439297aed3 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AuthModuleDigest.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AuthModuleDigest.cs @@ -11,11 +11,7 @@ namespace Xamarin.Android.Net { sealed class AuthModuleDigest : IAndroidAuthenticationModule { -#if MONOANDROID1_0 - const string LOG_APP = AndroidClientHandler.LOG_APP + "-digest-auth"; -#else const string LOG_APP = AndroidMessageHandler.LOG_APP + "-digest-auth"; -#endif static readonly object cache_lock = new object (); static readonly Dictionary cache = new Dictionary (); diff --git a/src/Mono.Android/Xamarin.Android.Net/AuthenticationData.cs b/src/Mono.Android/Xamarin.Android.Net/AuthenticationData.cs index 15fa511e9a7..ca40df6575a 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AuthenticationData.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AuthenticationData.cs @@ -1,24 +1,14 @@ namespace Xamarin.Android.Net { /// -#if MONOANDROID1_0 - /// Contains all the information required to perform pre-authentication of HTTP requests. See . -#else /// Contains all the information required to perform pre-authentication of HTTP requests. See . -#endif /// public class AuthenticationData { /// -#if MONOANDROID1_0 - /// Gets the authentication scheme. If instance of AuthenticationData comes from the - /// collection it will have this property set to the type of authentication as requested by the server, or to AuthenticationScheme.Unsupported/>. - /// In the latter case the application is required to provide the authentication module in . -#else /// Gets the authentication scheme. If instance of AuthenticationData comes from the /// collection it will have this property set to the type of authentication as requested by the server, or to AuthenticationScheme.Unsupported/>. /// In the latter case the application is required to provide the authentication module in . -#endif /// /// The authentication scheme. public AuthenticationScheme Scheme { get; set; } = AuthenticationScheme.None; @@ -31,15 +21,9 @@ public class AuthenticationData public string? Challenge { get; internal set; } /// -#if MONOANDROID1_0 - /// Indicates whether authentication performed using data in this instance should be done for the end server or a proxy. If instance of - /// AuthenticationData comes from the collection it will have this property set to - /// true if authentication request came from a proxy, false otherwise. -#else /// Indicates whether authentication performed using data in this instance should be done for the end server or a proxy. If instance of /// AuthenticationData comes from the collection it will have this property set to /// true if authentication request came from a proxy, false otherwise. -#endif /// /// true to use proxy authentication. public bool UseProxyAuthentication { get; set; } diff --git a/src/Mono.Android/Xamarin.Android.Net/AuthenticationScheme.cs b/src/Mono.Android/Xamarin.Android.Net/AuthenticationScheme.cs index 78f78666724..28427da3ca9 100644 --- a/src/Mono.Android/Xamarin.Android.Net/AuthenticationScheme.cs +++ b/src/Mono.Android/Xamarin.Android.Net/AuthenticationScheme.cs @@ -1,11 +1,7 @@ namespace Xamarin.Android.Net { /// -#if MONOANDROID1_0 - /// Authentication schemes supported by -#else /// Authentication schemes supported by -#endif /// public enum AuthenticationScheme { @@ -15,11 +11,7 @@ public enum AuthenticationScheme None, /// -#if MONOANDROID1_0 - /// doesn't support this scheme, the application must provide its own value. See -#else /// doesn't support this scheme, the application must provide its own value. See -#endif /// Unsupported, diff --git a/src/Mono.Android/Xamarin.Android.Net/IAndroidAuthenticationModule.cs b/src/Mono.Android/Xamarin.Android.Net/IAndroidAuthenticationModule.cs index 6ed658d1d5c..4d7b5bf9a2e 100644 --- a/src/Mono.Android/Xamarin.Android.Net/IAndroidAuthenticationModule.cs +++ b/src/Mono.Android/Xamarin.Android.Net/IAndroidAuthenticationModule.cs @@ -5,22 +5,13 @@ namespace Xamarin.Android.Net { /// -#if MONOANDROID1_0 - /// Implement this interface in order to provide support for HTTP authentication scheme not supported by -#else /// Implement this interface in order to provide support for HTTP authentication scheme not supported by -#endif /// public interface IAndroidAuthenticationModule { /// -#if MONOANDROID1_0 - /// The authentication scheme supported by the implementation. Should be set to AuthenticationScheme.Unsupported for - /// schemes unsupported by natively. -#else /// The authentication scheme supported by the implementation. Should be set to AuthenticationScheme.Unsupported for /// schemes unsupported by natively. -#endif /// /// The scheme. AuthenticationScheme Scheme { get; } @@ -38,13 +29,8 @@ public interface IAndroidAuthenticationModule bool CanPreAuthenticate { get; } /// -#if MONOANDROID1_0 - /// Authenticate using the specified challenge, request and credentials. This is currently not used by - /// since the requests aren't restarted automatically, but it can be used in the future implementations of -#else /// Authenticate using the specified challenge, request and credentials. This is currently not used by /// since the requests aren't restarted automatically, but it can be used in the future implementations of -#endif /// /// instance which contains the value of the response header to authorize the connection /// Challenge. diff --git a/src/Mono.Android/Xamarin.Android.Net/ServerCertificateCustomValidator.cs b/src/Mono.Android/Xamarin.Android.Net/ServerCertificateCustomValidator.cs index ac6cb91d599..77427cfea10 100644 --- a/src/Mono.Android/Xamarin.Android.Net/ServerCertificateCustomValidator.cs +++ b/src/Mono.Android/Xamarin.Android.Net/ServerCertificateCustomValidator.cs @@ -1,9 +1,12 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Net.Http; using System.Net.Security; using System.Security.Cryptography.X509Certificates; +using Android.OS; +using Android.Runtime; using Javax.Net.Ssl; using JavaCertificateException = Java.Security.Cert.CertificateException; @@ -24,19 +27,19 @@ public ServerCertificateCustomValidator (Func _serverCertificateCustomValidationCallback; public TrustManager ( - IX509TrustManager? internalTrustManager, + IX509TrustManager internalTrustManager, HttpRequestMessage request, Func serverCertificateCustomValidationCallback) { @@ -50,7 +53,7 @@ public void CheckServerTrusted (JavaX509Certificate[] javaChain, string authType var sslPolicyErrors = SslPolicyErrors.None; try { - _internalTrustManager?.CheckServerTrusted (javaChain, authType); + _internalTrustManager.CheckServerTrusted (javaChain, authType); } catch (JavaCertificateException) { sslPolicyErrors |= SslPolicyErrors.RemoteCertificateChainErrors; } @@ -158,33 +161,47 @@ private sealed class AlwaysAcceptingHostnameVerifier : Java.Lang.Object, IHostna public bool Verify (string? hostname, ISSLSession? session) => true; } - private static IX509TrustManager? FindX509TrustManager(ITrustManager[]? trustManagers) + [DynamicDependency(nameof(IX509TrustManager.CheckServerTrusted), typeof(IX509TrustManagerInvoker))] + [DynamicDependency(nameof(IX509TrustManager.CheckServerTrusted), typeof(X509ExtendedTrustManagerInvoker))] + private static IX509TrustManager FindX509TrustManager(ITrustManager[] trustManagers, out int index) { - if (trustManagers is null) - return null; + for (int i = 0; i < trustManagers.Length; i++) { + var trustManager = trustManagers [i]; + if (trustManager is IX509TrustManager x509TrustManager) { + index = i; + return x509TrustManager; + } - foreach (var trustManager in trustManagers) { - if (trustManager is IX509TrustManager tm) - return tm; + // On API 21-23, the default Java trust manager is TrustManagerImpl from Conscrypt. The class implements X509TrustManager + // but the .NET pattern matching will fail in this case and we need to cast it explicitly. + int apiLevel = (int)Build.VERSION.SdkInt; + if (apiLevel <= 23) { + if (IsTrustManagerImpl (trustManager)) { + index = i; + return trustManager.JavaCast (); + } + } } - return null; + throw new InvalidOperationException($"Could not find {nameof(IX509TrustManager)} in {nameof(ITrustManager)} array."); + + static bool IsTrustManagerImpl (ITrustManager trustManager) + { + var javaClassName = JNIEnv.GetClassNameFromInstance (trustManager.Handle); + return javaClassName.Equals ("com/android/org/conscrypt/TrustManagerImpl", StringComparison.Ordinal); + } } - private static ITrustManager[] ModifyTrustManagersArray (ITrustManager[] trustManagers, IX509TrustManager? original, IX509TrustManager replacement) + private static ITrustManager[] ModifyTrustManagersArray (ITrustManager[] trustManagers, int originalTrustManagerIndex, IX509TrustManager replacement) { - var modifiedTrustManagersCount = original is null ? trustManagers.Length + 1 : trustManagers.Length; - var modifiedTrustManagersArray = new ITrustManager [modifiedTrustManagersCount]; - - modifiedTrustManagersArray [0] = replacement; - int nextIndex = 1; + var modifiedTrustManagersArray = new ITrustManager [trustManagers.Length]; for (int i = 0; i < trustManagers.Length; i++) { - if (trustManagers [i] == original) { - continue; + if (i == originalTrustManagerIndex) { + modifiedTrustManagersArray [i] = replacement; + } else { + modifiedTrustManagersArray [i] = trustManagers [i]; } - - modifiedTrustManagersArray [nextIndex++] = trustManagers [i]; } return modifiedTrustManagersArray; diff --git a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixLegacyResourceDesignerStep.cs b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixLegacyResourceDesignerStep.cs index 2f8569f515a..e07ec5e9751 100644 --- a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixLegacyResourceDesignerStep.cs +++ b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/FixLegacyResourceDesignerStep.cs @@ -30,6 +30,7 @@ public class FixLegacyResourceDesignerStep : LinkDesignerBase AssemblyDefinition designerAssembly = null; TypeDefinition designerType = null; Dictionary lookup; + Dictionary lookupCaseInsensitive; protected override void EndProcess () { @@ -61,7 +62,7 @@ protected override void LoadDesigner () LogMessage ($" Did not find {DesignerAssemblyNamespace}.Resource type. It was probably linked out."); return; } - lookup = BuildResourceDesignerPropertyLookup (designerType); + lookup = BuildResourceDesignerPropertyLookup (designerType, out lookupCaseInsensitive); } finally { designerLoaded = true; } @@ -105,10 +106,11 @@ internal override bool ProcessAssemblyDesigner (AssemblyDefinition assembly) return true; } - Dictionary BuildResourceDesignerPropertyLookup (TypeDefinition type) + Dictionary BuildResourceDesignerPropertyLookup (TypeDefinition type, out Dictionary caseInsensitiveLookup) { LogMessage ($" Building Designer Lookups for {type.FullName}"); var output = new Dictionary (StringComparer.Ordinal); + caseInsensitiveLookup = new Dictionary (StringComparer.OrdinalIgnoreCase); foreach (TypeDefinition definition in type.NestedTypes) { foreach (PropertyDefinition property in definition.Properties) @@ -117,7 +119,9 @@ Dictionary BuildResourceDesignerPropertyLookup (TypeDe if (output.ContainsKey (key)) { LogMessage ($" Found duplicate {key}"); } else { + LogMessage ($" Adding {key}"); output.Add (key, property.GetMethod); + caseInsensitiveLookup [key] = property.GetMethod; } } } @@ -135,6 +139,32 @@ string GetNativeTypeNameFromManagedTypeName (string name) } } + string GetFixupKey (Instruction instruction, string designerFullName) + { + string line = instruction.ToString (); + int idx = line.IndexOf (designerFullName, StringComparison.Ordinal); + if (idx >= 0) { + return line.Substring (idx + designerFullName.Length); + } + if (instruction.Operand is FieldReference fieldRef && + (fieldRef.DeclaringType?.ToString()?.Contains (".Resource/") ?? false)) { + var canResolve = false; + try { + var resolved = fieldRef.Resolve (); + canResolve = resolved != null; + } catch (Exception) { + } + if (canResolve) + return null; + var type = fieldRef.DeclaringType.FullName; + var s = type.LastIndexOf ('/'); + type = type.Substring (s + 1); + var key = type + "::" + fieldRef.Name; + return key; + } + return null; + } + protected override void FixBody (MethodBody body, TypeDefinition designer) { // replace @@ -148,13 +178,16 @@ protected override void FixBody (MethodBody body, TypeDefinition designer) { if (i.OpCode != OpCodes.Ldsfld) continue; - string line = i.ToString (); - int idx = line.IndexOf (designerFullName, StringComparison.Ordinal); - if (idx >= 0) { - string key = line.Substring (idx + designerFullName.Length); + var key = GetFixupKey (i, designerFullName); + if (key != null) { LogMessage ($"Looking for {key}."); - if (lookup.TryGetValue (key, out MethodDefinition method)) { - var importedMethod = designer.Module.ImportReference (method); + var found = lookup.TryGetValue (key, out MethodDefinition method); + if (!found) { + LogMessage ($"DEBUG! Failed to find {key}! Trying case insensitive lookup."); + found = lookupCaseInsensitive.TryGetValue (key, out method); + } + if (found) { + var importedMethod = body.Method.Module.ImportReference (method); var newIn = Instruction.Create (OpCodes.Call, importedMethod); instructions.Add (i, newIn); } else { diff --git a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/LinkDesignerBase.cs b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/LinkDesignerBase.cs index d8c65f1b573..d999506b286 100644 --- a/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/LinkDesignerBase.cs +++ b/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/LinkDesignerBase.cs @@ -60,6 +60,37 @@ protected bool FindResourceDesigner (AssemblyDefinition assembly, bool mainAppli } } + + if (string.IsNullOrEmpty(designerFullName)) { + LogMessage ($"Inspecting member references for assembly: {assembly.FullName};"); + var memberRefs = assembly.MainModule.GetMemberReferences (); + foreach (var memberRef in memberRefs) { + string declaringType = memberRef.DeclaringType?.ToString () ?? string.Empty; + if (!declaringType.Contains (".Resource/")) { + continue; + } + if (declaringType.Contains ("_Microsoft.Android.Resource.Designer")) { + continue; + } + var resolved = false; + try { + var def = memberRef.Resolve (); + if (resolved = def != null) { + LogMessage ($"Resolved member `{memberRef?.Name}`"); + } + } catch (Exception ex) { + LogMessage ($"Exception resolving member `{memberRef?.Name}`: {ex}"); + resolved = false; + } + if (!resolved) { + LogMessage ($"Adding _Linker.Generated.Resource to {assembly.Name.Name}. Could not resolve {memberRef?.Name} : {declaringType}"); + designer = new TypeDefinition ("_Linker.Generated", "Resource", TypeAttributes.Public | TypeAttributes.AnsiClass); + designer.BaseType = new TypeDefinition ("System", "Object", TypeAttributes.Public | TypeAttributes.AnsiClass); + return true; + } + } + } + if (string.IsNullOrEmpty(designerFullName)) return false; diff --git a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets index fd0674e9946..d023fe0acc2 100644 --- a/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets +++ b/src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets @@ -41,6 +41,19 @@ It is shared between "legacy" binding projects and .NET 5 projects. + + + <_GeneratedManagedBindingFiles Include="$(GeneratedOutputPath)**\*.cs" /> + + + + + + + @@ -99,6 +112,7 @@ It is shared between "legacy" binding projects and .NET 5 projects. EnableBindingNestedInterfaceTypes="$(AndroidBoundInterfacesContainTypes)" EnableBindingInterfaceConstants="$(AndroidBoundInterfacesContainConstants)" EnableRestrictToAttributes="$(AndroidEnableRestrictToAttributes)" + EnableObsoleteOverrideInheritance="$(AndroidEnableObsoleteOverrideInheritance)" Nullable="$(Nullable)" UseJavaLegacyResolver="$(_AndroidUseJavaLegacyResolver)" NamespaceTransforms="@(AndroidNamespaceReplacement)" @@ -107,14 +121,23 @@ It is shared between "legacy" binding projects and .NET 5 projects. + + + + + + Condition=" '$(_AndroidGenerateManagedBindings)' == 'true' Or '@(_GeneratedManagedBindingFiles->Count())' != '0' " + DependsOnTargets="GenerateBindings;_CollectGeneratedManagedBindingFiles"> + + + true + - + diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets index 4bfa0ff3d74..346c89aa99b 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.BuildOrder.targets @@ -118,6 +118,7 @@ properties that determine build ordering. _BuildResourceDesigner; UpdateAndroidInterfaceProxies; _SetAndroidGenerateManagedBindings; + _ClearGeneratedManagedBindings; AddBindingsToCompile; _CheckForInvalidDesignerConfig; @@ -178,7 +179,6 @@ properties that determine build ordering. _BeforeGetAndroidDependencies; _SetLatestTargetFrameworkVersion; _ResolveSdks; - _ResolveMonoAndroidSdks; _ResolveAndroidTooling; $(GetAndroidDependenciesDependsOn); diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index 2ec7baa7784..9430a8a63d3 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -14,6 +14,7 @@ true false $(AndroidGenerateResourceDesigner) + true false false false @@ -39,6 +40,7 @@ true true true + true obsolete @@ -73,7 +75,7 @@ This prevents an early error message during 'dotnet publish'. We handle $(SelfContained) in a custom way where it is forced to be true. --> - false + false SdkOnly None diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json index 8ab0ca24494..df89fd896b1 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json @@ -13,7 +13,7 @@ "Microsoft.Android.Runtime.34.android-x64", "Microsoft.Android.Templates" ], - "platforms": [ "win-x64", "win-arm64", "linux-x64", "osx-x64", "osx-arm64" ], + "platforms": [ "win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64" ], "extends" : [ "microsoft-net-runtime-android-net7", "microsoft-net-runtime-android-aot-net7", @@ -32,7 +32,8 @@ "win-x86": "Microsoft.Android.Sdk.Windows", "win-x64": "Microsoft.Android.Sdk.Windows", "win-arm64": "Microsoft.Android.Sdk.Windows", - "linux-x64": "Microsoft.Android.Sdk.Linux" + "linux-x64": "Microsoft.Android.Sdk.Linux", + "linux-arm64": "Microsoft.Android.Sdk.Linux" } }, "Microsoft.Android.Sdk.net7": { @@ -44,7 +45,8 @@ "win-x86": "Microsoft.Android.Sdk.Windows", "win-x64": "Microsoft.Android.Sdk.Windows", "win-arm64": "Microsoft.Android.Sdk.Windows", - "linux-x64": "Microsoft.Android.Sdk.Linux" + "linux-x64": "Microsoft.Android.Sdk.Linux", + "linux-arm64": "Microsoft.Android.Sdk.Linux" } }, "Microsoft.Android.Ref.34": { diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 4f8e7e69711..b93a04367ef 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -1397,20 +1397,20 @@ public static string XA5207 { } /// - /// Looks up a localized string similar to Tools > Open Android SDK Manager.... + /// Looks up a localized string similar to Tools > Android > Android SDK Manager.... /// - public static string XA5207_SDK_Manager_macOS { + public static string XA5207_SDK_Manager_Windows { get { - return ResourceManager.GetString("XA5207_SDK_Manager_macOS", resourceCulture); + return ResourceManager.GetString("XA5207_SDK_Manager_Windows", resourceCulture); } } /// - /// Looks up a localized string similar to Tools > Android > Android SDK Manager.... + /// Looks up a localized string similar to Tools > Open Android SDK Manager.... /// - public static string XA5207_SDK_Manager_Windows { + public static string XA5207_SDK_Manager_CLI { get { - return ResourceManager.GetString("XA5207_SDK_Manager_Windows", resourceCulture); + return ResourceManager.GetString("XA5207_SDK_Manager_CLI", resourceCulture); } } diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx index b3ac4ef0c9a..75c9bb27c46 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.cs.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Soubor LibraryProjectProperties {0} se nachází v adresáři, který je nadřazený přechodnému výstupnímu adresáři vazebního projektu. Upravte prosím cestu tak, aby se používal původní soubor project.properties přímo z adresáře projektu knihovny Androidu. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Ignoruje se konfigurační soubor {0}. Konfigurační soubory .NET se v projektech Xamarin.Androidu, které cílí na .NET 6 nebo vyšší, nepodporují. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Ignoruje se konfigurační soubor {0}. Konfigurační soubory .NET se v projektech .NET pro Android, které cílí na .NET 6 nebo vyšší, nepodporují. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Používání AAPT se v projektech Xamarin.Androidu, které cílí na .NET 6 nebo vyšší, nepodporuje. Povolte prosím možnost Použít systém přírůstkového balení pro Android (aapt2) na stránce vlastností projektu sady Visual Studio, nebo upravte soubor projektu v textovém editoru a nastavte vlastnost MSBuildu AndroidUseAapt2 na true. + Používání AAPT se v projektech .NET pro Android, které cílí na .NET 6 nebo vyšší, nepodporuje. Povolte prosím možnost Použít systém přírůstkového balení pro Android (aapt2) na stránce vlastností projektu sady Visual Studio, nebo upravte soubor projektu v textovém editoru a nastavte vlastnost MSBuildu AndroidUseAapt2 na true. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Buď změňte hodnotu v souboru AndroidManifest.xml tak, aby odpovídala hodnot {1} - The SupportedOSPlatformVersion property value - Použití funkce AppDomain.CreateDomain() zjištěné v sestavení: {0}. .NET 6 a vyšší bude podporovat jenom jednu doménu AppDomain, takže toto rozhraní API už nebude dostupné v Xamarin.Android po vydání .NET 6. + Použití funkce AppDomain.CreateDomain() zjištěné v sestavení: {0}. .NET 6 a vyšší bude podporovat jenom jednu doménu AppDomain, takže toto rozhraní API po vydání .NET 6 už v .NET pro Android nebude dostupné. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Hodnota parseru tříd Androidu {0} je zastaralá a v budoucí verzi Xamarin.Androidu se odebere. Aktualizujte vlastnosti projektu tak, aby používaly class-parse. + Hodnota analyzátoru tříd Androidu {0} je zastaralá a v budoucí verzi .NET pro Android se odebere. Aktualizujte vlastnosti projektu tak, aby používaly class-parse. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Cíl generování kódu pro Androidu {0} je zastaralý a v budoucí verzi Xamarin.Androidu se odebere. Aktualizujte vlastnosti projektu tak, aby používaly XAJavaInterop1. + Cíl generování kódu pro Androidu {0} je zastaralý a v budoucí verzi .NET pro Android se odebere. Aktualizujte vlastnosti projektu tak, aby používaly XAJavaInterop1. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Odkazování na projekt aplikace pro Android Wear {0} z projektu aplikace pro Android je zastaralé a v budoucí verzi Xamarin.Androidu se už nebude podporovat. Odeberte odkaz na projekt aplikace pro Android Wear z projektu aplikace pro Android a distribuujte aplikaci pro Wear jako samostatnou aplikaci. + Odkazování na projekt aplikace pro Android Wear {0} z projektu aplikace pro Android je zastaralé a v budoucí verzi .NET pro Android se už nebude podporovat. Odeberte odkaz na projekt aplikace pro Android Wear z projektu aplikace pro Android a distribuujte aplikaci pro Wear jako samostatnou aplikaci. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Odeberte z projektu odkaz na {0} a místo toho přidejte balíček NuGet{1}. {0} - The missing tool name - Nepovedlo se najít android.jar pro úroveň rozhraní API {0}. To znamená, že platforma sady Android SDK pro úroveň rozhraní API {0} není nainstalovaná. Buď ji nainstalujte ve Správci sady Android SDK ({2}), nebo změňte projekt Xamarin.Android tak, aby cílil na verzi rozhraní API, která je nainstalovaná. (Chybí {1}.) + Soubor android.jar pro úroveň rozhraní API {0} nebyl nalezen. To znamená, že platforma Android SDK pro úroveň rozhraní API {0} není nainstalovaná. Očekávalo se, že bude v: {1}. +{2} +Další podrobnosti najdete na https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Nástroje > Otevřít správce sady Android SDK... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Nástroje > Android > Správce sady Android SDK... - This string is the location of a menu command in Visual Studio. + Buď tuto komponentu nainstalujte ve Správci sady Android SDK (Nástroje > Android > Správce sady Android SDK…), nebo změňte projekt .NET pro Android tak, aby cílil na nainstalovanou verzi rozhraní API. + This string is the instrucitons to install the component + + + Chybějící úroveň rozhraní API můžete nainstalovat spuštěním příkazu dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}", případně můžete změnit projekt tak, aby cílil na nainstalovanou verzi rozhraní API. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Název vložené aplikace pro Wear se liší od názvu balíčku aplikace pro kapesní zařízení ({0} != {1}). @@ -943,4 +947,8 @@ Pokud chcete pro sestavení z příkazového řádku použít vlastní cestu JDK {0} - An Android Resource Identifier. + + Knihovny podpory pr Android se v .NET 9 a novějších verzích nepodporují. Migrujte prosím na AndroidX. Další podrobnosti najdete v https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx index 584e372be41..61506030467 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Die LibraryProjectProperties-Datei "{0}" befindet sich in einem übergeordneten Verzeichnis des Zwischenausgabeverzeichnisses für das Bindungsprojekt. Passen Sie den Pfad so an, dass die ursprüngliche Datei "project.properties" direkt aus dem Android-Bibliotheksprojektverzeichnis verwendet wird. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Die Konfigurationsdatei "{0}" wird ignoriert. .NET-Konfigurationsdateien werden in Xamarin.Android-Projekten für .NET 6 oder höher nicht unterstützt. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Die Konfigurationsdatei "{0}" wird ignoriert. .NET-Konfigurationsdateien werden in .NET Android-Projekten, die auf .NET 6 oder höher ausgerichtet sind, nicht unterstützt. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Die Verwendung von AAPT wird in Xamarin.Android-Projekten für .NET 6 oder höher nicht unterstützt. Aktivieren Sie "Inkrementelles Android-Paketierungssystem (aapt2) verwenden" in den Visual Studio-Projekteigenschaftenseiten, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und legen Sie die MSBuild-Eigenschaft "AndroidUseAapt2" auf TRUE fest. + Die Verwendung von AAPT wird in .NET Android-Projekten, die auf .NET 6 oder höher ausgerichtet sind, nicht unterstützt. Aktivieren Sie "Inkrementelles Android-Paketierungssystem (aapt2) verwenden" in den Visual Studio-Projekteigenschaftsseiten, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und legen Sie die MSBuild-Eigenschaft "AndroidUseAapt2" auf WAHR fest. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Bitte ändern Sie den Wert in einen Assembly-basierten Typnamen, der von „{1} {1} - The SupportedOSPlatformVersion property value - In der Assembly "{0}" wurde die Verwendung von "AppDomain.CreateDomain()" festgestellt. .NET 6 und höher unterstützt nur eine einzelne AppDomain, sodass diese API nach dem Release von .NET 6 nicht mehr in Xamarin.Android verfügbar ist. + Die Verwendung von AppDomain.CreateDomain() wurde in der Assembly {0} erkannt. .NET 6 und höher unterstützt nur eine einzelne AppDomain, sodass diese API nach der Veröffentlichung von .NET 6 nicht mehr in .NET Android verfügbar ist. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Der Wert "{0}" des Android-Klassenparsers ist veraltet und wird in einer zukünftigen Version von Xamarin.Android entfernt. Aktualisieren Sie die Projekteigenschaften auf die Verwendung von "class-parse". + Der Android-Klassenparserwert "{0}" ist veraltet und wird in einer zukünftigen Version von .NET Android entfernt. Aktualisieren Sie die Projekteigenschaften, um "class-parse" zu verwenden. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Das Ziel "{0}" für die Android-Codegenerierung ist veraltet und wird in einer zukünftigen Version von Xamarin.Android entfernt. Aktualisieren Sie die Projekteigenschaften auf die Verwendung von "XAJavaInterop1". + Das Android-Codegenerierungsziel "{0}" ist veraltet und wird in einer zukünftigen Version von .NET Android entfernt. Aktualisieren Sie die Projekteigenschaften, um "XAJavaInterop1" zu verwenden. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Verweise von einem Android-Anwendungsprojekt auf das Android Wear-Anwendungsprojekt "{0}" ist veraltet und wird in zukünftigen Versionen von Xamarin.Android nicht mehr unterstützt. Entfernen Sie den Verweis auf das Android Wear-Anwendungsprojekt aus dem Android-Anwendungsprojekt, und verteilen Sie die Wear-Anwendung stattdessen als eigenständige Anwendung. + Das Verweisen auf das Android Wear-Anwendungsprojekt "{0}" aus einem Android-Anwendungsprojekt ist veraltet und wird in einer zukünftigen Version von .NET Android nicht mehr unterstützt. Entfernen Sie den Verweis auf das Android Wear-Anwendungsprojekt aus dem Android-Anwendungsprojekt, und verteilen Sie die Wear-Anwendung stattdessen als eigenständige Anwendung. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Entfernen Sie den '{0}' Verweis aus Ihrem Projekt, und fügen Sie stattdessen da {0} - The missing tool name - "android.jar" wurde für API-Ebene {0} nicht gefunden. Dies bedeutet, dass die Android SDK-Plattform für API-Ebene {0} nicht installiert ist. Führen Sie die Installation entweder im Android-SDK-Manager ({2}) durch, oder ändern Sie das Xamarin.Android-Projekt, um eine installierte API-Version als Ziel zu verwenden ("{1}" fehlt.) + android.jar für API-Ebene {0} wurde nicht gefunden. Dies bedeutet, dass die Android SDK-Plattform für die API-Ebene {0} nicht installiert ist. Es wurde erwartet, dass sie sich in "{1}" befindet. +{2} +Weitere Informationen finden Sie unter https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Extras > Android-SDK-Manager öffnen... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Extras > Android > Android-SDK-Manager... - This string is the location of a menu command in Visual Studio. + Installieren Sie es entweder im Android SDK-Manager (Tools > Android > Android SDK-Manager...), oder ändern Sie das .NET Android-Projekt so, dass es auf eine installierte API-Version abzielt. + This string is the instrucitons to install the component + + + Sie können die fehlende API-Ebene installieren, indem Sie "dotnet build -t:InstallAndroidDependencies -f" {0} "-p:AndroidSdkDirectory={1}" ausführen oder das Projekt so ändern, dass es auf eine installierte API-Version ausgerichtet wird. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Der Name des eingebetteten Wear-App-Pakets weicht vom Namen des Handheld-App-Pakets ab ({0} != {1}). @@ -943,4 +947,8 @@ Um einen benutzerdefinierten JDK-Pfad für einen Befehlszeilenbuild zu verwenden {0} - An Android Resource Identifier. + + Die Android-Unterstützungsbibliotheken werden in .NET 9 und höher nicht unterstützt. Migrieren Sie zu AndroidX. Weitere Informationen finden Sie https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx index 49188ee7da4..2349d3b98d2 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.es.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex El archivo "LibraryProjectProperties" en "{0}" se encuentra en un directorio principal del directorio de salida intermedio del proyecto de enlaces. Ajuste la ruta de acceso para usar el archivo "project.properties" original directamente desde el directorio del proyecto de la biblioteca de Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Omitiendo el archivo de configuración "{0}". Los archivos de configuración .NET no se admiten en proyectos Xamarin.Android destinados a .NET 6 o versiones posteriores. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Ignorando el archivo de configuración "{0}". Los archivos de configuración .NET no son compatibles con proyectos .NET Android que tengan como objetivo .NET 6 o superior. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - No se admite el uso de AAPT en los proyectos de Xamarin.Android destinados a .NET 6 o versiones posteriores. Habilite "Use el sistema de empaquetado de Android incremental (aapt2)" en las páginas de propiedades del proyecto de Visual Studio o edite el archivo del proyecto en un editor de texto y establezca la propiedad "AndroidUseAapt2" de MSBuild en "true". + El uso de AAPT no es compatible con proyectos .NET Android que tengan como objetivo .NET 6 o superior. Habilite "Use el sistema de empaquetado de Android incremental (aapt2)" en las páginas de propiedades del proyecto de Visual Studio o edite el archivo del proyecto en un editor de texto y establezca la propiedad "AndroidUseAapt2" de MSBuild en "true". The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Cambie el valor de AndroidManifest.xml para que coincida con el valor $(Supporte {1} - The SupportedOSPlatformVersion property value - Se detectó el uso de AppDomain.CreateDomain() en el ensamblado: {0}. En .NET 6 y versiones posteriores solo se admitirá una instancia de AppDomain, por lo que esta API ya no estará disponible en Xamarin.Android una vez que se haya lanzado .NET 6. + Uso de AppDomain.CreateDomain() detectado en el ensamblado: {0}.NET 6 y superiores solo admitirán un único AppDomain, por lo que esta API dejará de estar disponible en .NET Android una vez que se publique .NET 6. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - El valor "{0}" del analizador de clases de Android está en desuso y se quitará en una versión futura de Xamarin.Android. Actualice las propiedades del proyecto para usar "class-parse". + El valor "{0}" del analizador de clases de Android está obsoleto y se eliminará en una futura versión de .NET Android. Actualice las propiedades del proyecto para usar "class-parse". The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - El destino "{0}" de generación de código de Android está en desuso y se quitará en una versión futura de Xamarin.Android. Actualice las propiedades del proyecto para usar "XAJavaInterop1". + El objetivo de generación de código Android "{0}" está obsoleto y se eliminará en una futura versión de .NET Android. Actualice las propiedades del proyecto para usar "XAJavaInterop1". The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - La referencia al proyecto de aplicación Android Wear "{0}" de un proyecto de aplicación Android está en desuso y ya no se admitirá en una versión futura de Xamarin.Android. Quítela y distribuya en cambio la aplicación Wear como una aplicación independiente. + Hacer referencia al proyecto de aplicación Android Wear "{0}" desde un proyecto de aplicación Android está obsoleto y ya no se admitirá en una versión futura de .NET Android. Elimine la referencia al proyecto de la aplicación Android Wear del proyecto de la aplicación Android y distribuya en su lugar la aplicación Wear como una aplicación independiente. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Quite la referencia de "{0}" del proyecto y agregue el paquete NuGet "{1}". {0} - The missing tool name - No se encontró ningún archivo android.jar para el nivel de API {0}. Esto significa que la plataforma Android SDK para el nivel de API {0} no está instalada. Instálela en el Administrador de Android SDK ({2}) o cambie el proyecto Xamarin.Android para que tenga como destino una versión de la API que esté instalada. (Falta {1}). + No se ha podido encontrar android.jar para el nivel API {0}. Esto significa que la plataforma Android SDK para el nivel API {0} no está instalada; se esperaba que estuviera en "{1}". +{2} +Consulte https://aka.ms/xa5207 para obtener más detalles. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Herramientas > Abrir el Administrador de Android SDK... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Herramientas > Android > Administrador de Android SDK... - This string is the location of a menu command in Visual Studio. + Instálelo en el Android SDK Manager (herramientas > Android > Android SDK Manager...) o cambie el proyecto .NET Android para que se dirija a una versión de la API que esté instalada. + This string is the instrucitons to install the component + + + Puede instalar el nivel de API que falta ejecutando "dotnet build -t:InstallAndroidDependencies -f {0}"-p:AndroidSdkDirectory={1}"`, o cambiar el proyecto para que tenga como objetivo una versión de API que esté instalada. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. El nombre del paquete de la aplicación Wear que se ha insertado es distinto del nombre del paquete de la aplicación para dispositivos de mano ({0}! = {1}). @@ -943,4 +947,8 @@ Para usar una ruta de acceso de JDK personalizada para una compilación de líne {0} - An Android Resource Identifier. + + Las bibliotecas de compatibilidad con Android no se admiten en .NET 9 y versiones posteriores. Migre a AndroidX. Consulte https://aka.ms/xamarin/androidx para obtener más detalles. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx index 409fdaf0f32..f723bbbfe55 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.fr.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Le fichier 'LibraryProjectProperties' '{0}' se trouve dans un répertoire parent du répertoire de sortie intermédiaire du projet de liaisons. Modifiez le chemin pour utiliser le fichier 'project.properties' d'origine directement à partir du répertoire du projet de bibliothèque Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Fichier config '{0}' ignoré. Les fichiers config .NET ne sont pas pris en charge dans les projets Xamarin.Android qui ciblent .NET 6 ou une version ultérieure. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Fichier de configuration «{0}» ignoré. Les fichiers de configuration .NET ne sont pas pris en charge dans les projets Android .NET qui ciblent .NET 6 ou une version ultérieure. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - L'utilisation d'AAPT n'est pas prise en charge dans les projets Xamarin.Android qui ciblent .NET 6 ou une version ultérieure. Activez 'Utiliser le système d'empaquetage Android incrémentiel (aapt2)' dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte, puis affectez la valeur 'true' à la propriété MSBuild 'AndroidUseAapt2'. + L’utilisation d’AAPT n’est pas prise en charge dans les projets Android .NET qui ciblent .NET 6 ou une version ultérieure. Activez 'Utiliser le système d'empaquetage Android incrémentiel (aapt2)' dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte, puis affectez la valeur 'true' à la propriété MSBuild 'AndroidUseAapt2'. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Modifiez la valeur dans AndroidManifest.xml pour qu’elle corresponde à la val {1} - The SupportedOSPlatformVersion property value - Utilisation de AppDomain.CreateDomain() détectée dans l'assembly : {0}. .NET 6 et les versions ultérieures prend uniquement en charge un seul AppDomain. Cette API ne sera donc plus disponible dans Xamarin.Android après la publication de .NET 6. + Utilisation d’AppDomain.CreateDomain() détectée dans l’assembly : {0}. .NET 6 et versions ultérieures ne prennent en charge qu’un seul AppDomain. Cette API ne sera donc plus disponible dans .NET Android une fois .NET 6 publié. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - La valeur '{0}' de l'analyseur de classe Android est dépréciée et va être supprimée dans une future version de Xamarin.Android. Mettez à jour les propriétés du projet pour utiliser 'class-parse'. + La valeur de l’analyseur de classe Android «{0}» est déconseillée et sera supprimée dans une future version de .NET Android. Mettez à jour les propriétés du projet pour utiliser 'class-parse'. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - La cible de génération de code Android '{0}' est dépréciée et va être supprimée dans une future version de Xamarin.Android. Mettez à jour les propriétés du projet pour utiliser 'XAJavaInterop1'. + La cible de génération de code Android «{0}» est déconseillée et sera supprimée dans une future version de .NET Android. Mettez à jour les propriétés du projet pour utiliser 'XAJavaInterop1'. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - L'opération qui consiste à référencer le projet d'application Android Wear '{0}' à partir d'un projet d'application Android est dépréciée. Elle ne sera plus prise en charge dans une prochaine version de Xamarin.Android. Supprimez la référence au projet d'application Android Wear du projet d'application Android, et distribuez l'application Wear en tant qu'application autonome à la place. + Le référencement du projet d’application Android Wear «{0}» à partir d’un projet d’application Android est déconseillé et ne sera plus pris en charge dans une future version de .NET Android. Supprimez la référence du projet d’application Android Wear du projet d’application Android et distribuez l’application Wear en tant qu’application autonome à la place. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Supprimez la référence de '{0}' de votre projet et ajoutez plutôt le '{1}'.pa {0} - The missing tool name - Le fichier android.jar est introuvable pour le niveau d'API {0}. Cela signifie que la plateforme du kit Android SDK pour le niveau d'API {0} n'est pas installée. Installez-la dans le Gestionnaire SDK Android ({2}), ou changez le projet Xamarin.Android pour cibler une version d'API installée. ({1} manquant.) + Android.jar introuvable pour le niveau d’API {0}. Cela signifie que la plateforme Android SDK pour le niveau d’API {0} n’est pas installée ; il était attendu dans «{1}». +{2} +Pour plus d’informations, consultez https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Outils > Ouvrir le Gestionnaire SDK Android... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Outils > Android > Gestionnaire SDK Android... - This string is the location of a menu command in Visual Studio. + Installez-le dans le Gestionnaire SDK Android (Outils > Android > Gestionnaire SDK Android...), ou modifiez le projet Android .NET pour cibler une version d’API installée. + This string is the instrucitons to install the component + + + Vous pouvez installer le niveau d’API manquant en exécutant « dotnet build -t :InstallAndroidDependencies -f {0} « -p :AndroidSdkDirectory={1}« », ou modifiez le projet pour cibler une version d’API installée. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Le nom du package d'application Wear embarqué diffère du nom du package d'application du terminal portable ({0} != {1}). @@ -943,4 +947,8 @@ Pour utiliser un chemin JDK personnalisé pour une build de ligne de commande, d {0} - An Android Resource Identifier. + + Les bibliothèques Android Support ne sont pas prises en charge dans .NET 9 et les versions ultérieures, veuillez migrer vers AndroidX. Pour plus d’informations, consultez https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx index 220cd4b4170..28e7961196f 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.it.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Il file `{0}` di `LibraryProjectProperties` si trova in una directory padre della directory di output intermedia del progetto di binding. Modificare il percorso in modo da usare il file `project.properties` originale della directory del progetto della libreria Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Il file di configurazione '{0}' verrà ignorato. I file di configurazione .NET non sono supportati in progetti Xamarin.Android destinati a .NET 6 o versione successiva. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Il file di configurazione '{0}' verrà ignorato. I file di configurazione .NET non sono supportati in progetti .NET Android destinati a .NET 6 o versione successiva. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - L'uso di AAPT non è supportato in progetti Xamarin.Android destinati a .NET 6 o versione successiva. Abilitare 'Usa sistema di creazione pacchetti Android incrementale (AAPT2)' nelle pagine delle proprietà del progetto di Visual Studio o modificare il file di progetto in un editor di testo e impostare la proprietà 'AndroidUseAapt2' di MSBuild su 'true'. + L'uso di AAPT non è supportato in progetti .NET Android destinati a .NET 6 o versione successiva. Abilitare 'Usa sistema di creazione pacchetti Android incrementale (AAPT2)' nelle pagine delle proprietà del progetto di Visual Studio o modificare il file di progetto in un editor di testo e impostare la proprietà 'AndroidUseAapt2' di MSBuild su 'true'. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Modificare il valore in AndroidManifest.xml in modo che corrisponda al valore $( {1} - The SupportedOSPlatformVersion property value - È stato rilevato l'uso di AppDomain.CreateDomain() nell'assembly: {0}. .NET 6 e versioni successive supporteranno solo un singolo AppDomain, quindi questa API non sarà più disponibile in Xamarin.Android dopo il rilascio di .NET 6. + È stato rilevato l'uso di AppDomain.CreateDomain() nell'assembly: {0}. .NET 6 e versioni successive supporteranno solo un singolo AppDomain, quindi questa API non sarà più disponibile in .NET Android dopo il rilascio di .NET 6. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Il valore '{0}' del parser di classi Android è deprecato e verrà rimosso in una versione futura di Xamarin.Android. Aggiornare le proprietà del progetto in modo da usare 'class-parse'. + Il valore '{0}' del parser di classi Android è deprecato e verrà rimosso in una versione futura di .NET Android. Aggiornare le proprietà del progetto in modo da usare 'class-parse'. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - La destinazione '{0}' per la generazione del codice Android è deprecato e verrà rimosso in una versione futura di Xamarin.Android. Aggiornare le proprietà del progetto in modo da usare 'XAJavaInterop1'. + La destinazione '{0}' per la generazione del codice Android è deprecato e verrà rimosso in una versione futura di .NET Android. Aggiornare le proprietà del progetto in modo da usare 'XAJavaInterop1'. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Il riferimento a un progetto applicazione Android Wear '{0}' da un progetto Applicazione Android è deprecato e non sarà più supportato in una versione futura di Xamarin.Android. Rimuovere il riferimento al progetto Applicazione Android Wear dal progetto Applicazione Android e distribuire l'applicazione Wear come applicazione autonoma. + Il riferimento a un progetto applicazione Android Wear '{0}' da un progetto Applicazione Android è deprecato e non sarà più supportato in una versione futura di .NET Android. Rimuovere il riferimento al progetto Applicazione Android Wear dal progetto Applicazione Android e distribuire l'applicazione Wear come applicazione autonoma. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Rimuovere il riferimento '{0}' dal progetto e aggiungere invece il pacchetto NuG {0} - The missing tool name - Non è stato possibile trovare android.jar per il livello API {0}. Questo errore indica che la piattaforma Android SDK per il livello API {0} non è installata. Installarla in Gestione Android SDK ({2}) oppure modificare il progetto Xamarin.Android in modo che la destinazione sia una versione API installata ({1} mancante). + Non è stato possibile trovare android.jar per il livello API {0}. Ciò significa che la piattaforma Android SDK per {0} a livello di API non è installata; si prevedeva che fosse in '{1}'. +{2} +Per altri dettagli, vedi https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Strumenti > Apri Gestione Android SDK... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Strumenti > Android > Gestione Android SDK... - This string is the location of a menu command in Visual Studio. + Installalo in Gestione Android SDK (Strumenti > Android > Gestione Android SDK...) oppure modifica il progetto Android .NET in modo che sia destinato a una versione API installata. + This string is the instrucitons to install the component + + + Puoi installare il livello API mancante eseguendo 'dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"' o modifica il progetto in modo che sia destinato a una versione API installata. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Il nome del pacchetto dell'app Wear incorporata è diverso da quello dell'app palmare ({0} != {1}). @@ -943,4 +947,8 @@ Per usare un percorso JDK personalizzato per una compilazione della riga di coma {0} - An Android Resource Identifier. + + Le librerie di supporto Android non sono supportate in .NET 9 e versioni successive. Esegui la migrazione ad AndroidX. Per altri dettagli, vedi https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx index 49be2825bbb..7a49dccde6f 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ja.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex 'LibraryProjectProperties' ファイル '{0}' は、バインド プロジェクトの中間出力ディレクトリの親ディレクトリにあります。元の 'project.properties' ファイルを Android ライブラリ プロジェクト ディレクトリから直接使用するには、パスを調整してください。 The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - 構成ファイル '{0}' を無視しています。.NET 構成ファイルは、.NET 6 以降を対象とする Xamarin.Android プロジェクトではサポートされていません。 - The following are literal names and should not be translated: .NET, Xamarin.Android. + 構成ファイル '{0}' を無視しています。.NET 構成ファイルは、.NET 6 以降を対象とする .NET Android プロジェクトではサポートされていません。 + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - .NET 6 以降を対象とする Xamarin.Android プロジェクトでは、AAPT の使用はサポートされていません。Visual Studio プロジェクトのプロパティ ページで [インクリメンタル Android パッケージ システム (aapt2) を使用します] を有効にするか、テキスト エディターでプロジェクト ファイルを編集して 'AndroidUseAapt2' MSBuild プロパティを 'true' に設定してください。 + .NET 6 以降を対象とする .NET Android プロジェクトでは、AAPT の使用はサポートされていません。Visual Studio プロジェクトのプロパティ ページで [インクリメンタル Android パッケージ システム (aapt2) を使用します] を有効にするか、テキスト エディターでプロジェクト ファイルを編集して 'AndroidUseAapt2' MSBuild プロパティを 'true' に設定してください。 The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -506,7 +506,7 @@ $(SupportedOSPlatformVersion) 値に一致するように AndroidManifest.xml {1} - The SupportedOSPlatformVersion property value - アセンブリ {0} で AppDomain.CreateDomain() が使用されていることが検出されました。.NET 6 以降では単一の AppDomain のみがサポートされる予定のため、.NET 6 がリリースされるとこの API は Xamarin.Android では使用できなくなります。 + アセンブリ {0} で AppDomain.CreateDomain() が使用されていることが検出されました。.NET 6 以降では単一の AppDomain のみがサポートされる予定のため、.NET 6 がリリースされるとこの API は .NET Android では使用できなくなります。 The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -705,12 +705,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Android クラス パーサーの値 '{0}' は非推奨であり、Xamarin.Android の今後のバージョンでは削除されます。'class-parse' を使用するようにプロジェクトのプロパティを更新してください。 + Android クラス パーサーの値 '{0}' は非推奨であり、.NET Android の今後のバージョンでは削除されます。'class-parse' を使用するようにプロジェクトのプロパティを更新してください。 The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Android コード生成ターゲット '{0}' は非推奨であり、Xamarin.Android の今後のバージョンでは削除されます。'XAJavaInterop1' を使用するようにプロジェクトのプロパティを更新してください。 + Android コード生成ターゲット '{0}' は非推奨であり、.NET Android の今後のバージョンでは削除されます。'XAJavaInterop1' を使用するようにプロジェクトのプロパティを更新してください。 The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -791,7 +791,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Android アプリケーション プロジェクトから Android Wear アプリケーション プロジェクト '{0}' を参照することは非推奨となり、Xamarin.Android の今後のバージョンではサポートされなくなります。Android アプリケーション プロジェクトから Android Wear アプリケーション プロジェクト参照を削除し、代わりにスタンドアロン アプリケーションとして Wear アプリケーションを配布してください。 + Android アプリケーション プロジェクトから Android Wear アプリケーション プロジェクト '{0}' を参照することは非推奨となり、.NET Android の今後のバージョンではサポートされなくなります。Android アプリケーション プロジェクトから Android Wear アプリケーション プロジェクト参照を削除し、代わりにスタンドアロン アプリケーションとして Wear アプリケーションを配布してください。 The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -862,19 +862,23 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing tool name - API レベル {0} の android .jar が見つかりませんでした。これは、API レベル {0} の Android SDK プラットフォームがインストールされていないことを意味します。Android SDK マネージャー ({2}) にインストールするか、インストールされている API バージョンを対象とする Xamarin.Android プロジェクトを変更します。({1} がありません。) + API レベル {0} の android.jar が見つかりません。これは、API レベル {0} の Android SDK プラットフォームがインストールされていないことを意味します。これは、`{1}` であることが想定されます。 +{2} +詳しくは https://aka.ms/xa5207 を参照してください。 The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - [ツール] > [Android SDK マネージャーを開く...] - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - [ツール] > [Android] > [Android SDK マネージャー...] - This string is the location of a menu command in Visual Studio. + Android SDK マネージャー ([ツール] > [Android] > [Android SDK マネージャー]...) にインストールするか、インストールされている API バージョンを対象とするように .NET Android プロジェクトを変更してください。 + This string is the instrucitons to install the component + + + 不足している API レベルをインストールするには、`dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"` を実行するか、インストールされている API バージョンを対象とするようにプロジェクトを変更します。 + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. 組み込みの Wear アプリ パッケージ名がハンドヘルド アプリ パッケージ名と異なります ({0}! = {1})。 @@ -944,4 +948,8 @@ In this message, the term "handheld app" means "app for handheld devices." {0} - An Android Resource Identifier. + + Android サポート ライブラリは .NET 9 以降ではサポートされていません。AndroidX に移行してください。詳細については、https://aka.ms/xamarin/androidx を参照してください。 + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx index 1d586b78bb8..67ac7f3cbb8 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ko.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex `LibraryProjectProperties` 파일 `{0}`이(가) 바인딩 프로젝트의 중간 출력 디렉터리의 부모 디렉터리에 있습니다. 경로를 조정하여 Android 라이브러리 프로젝트 디렉터리에서 바로 원본 `project.properties` 파일을 사용하세요. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - 구성 파일 '{0}'을(를) 무시합니다. .Net 6 이상을 대상으로 Xamarin.Android 프로젝트에서 .NET 구성 파일은 지원되지 않습니다. - The following are literal names and should not be translated: .NET, Xamarin.Android. + 구성 파일 '{0}'을(를) 무시합니다. .Net 6 이상을 대상으로 .NET Android 프로젝트에서 .NET 구성 파일은 지원되지 않습니다. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - AAPT는 .NET 6 이상을 대상으로 하는 Xamarin.Android 프로젝트에서 사용할 수 없습니다. Visual Studio 프로젝트 속성 페이지에서 '증분 Android 패키징 시스템(aapt2) 사용'을 사용하도록 설정하거나 텍스트 편집기에서 프로젝트 파일을 편집하고 'AndroidUseAapt2' MSBuild 속성을 'true'로 설정하세요. + AAPT는 .NET 6 이상을 대상으로 하는 .NET Android 프로젝트에서 사용할 수 없습니다. Visual Studio 프로젝트 속성 페이지에서 '증분 Android 패키징 시스템(aapt2) 사용'을 사용하도록 설정하거나 텍스트 편집기에서 프로젝트 파일을 편집하고 'AndroidUseAapt2' MSBuild 속성을 'true'로 설정하세요. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ AndroidManifest.xml의 값을 $(SupportedOSPlatformVersion) 값에 맞도록 변 {1} - The SupportedOSPlatformVersion property value - 어셈블리에서 AppDomain.CreateDomain()의 사용이 검색되었습니다. {0}. .NET 6 이상에서는 단일 AppDomain만 지원하므로 .NET 6이 릴리스된 후에는 이 API를 Xamarin.Android에서 더 이상 사용할 수 없습니다. + 어셈블리에서 AppDomain.CreateDomain() 사용이 검색되었습니다. {0}. .NET 6 이상에서는 단일 AppDomain만 지원하므로 .NET 6이 릴리스된 후에는 이 API를 .NET Android에서 더 이상 사용할 수 없습니다. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Android 클래스 파서 값 '{0}'은(는) 사용되지 않으며 Xamarin.Android의 이후 버전에서 제거됩니다. 'class-parse'를 사용하도록 프로젝트 속성을 업데이트하세요. + Android 클래스 파서 값 '{0}'은(는) 사용되지 않으며 .NET Android의 이후 버전에서 제거됩니다. 'class-parse'를 사용하도록 프로젝트 속성을 업데이트하세요. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Android 코드 생성 대상 '{0}'은(는) 사용되지 않으며 Xamarin.Android의 이후 버전에서 제거됩니다. 'XAJavaInterop1'을 사용하도록 프로젝트 속성을 업데이트하세요. + Android 코드 생성 대상 '{0}'은(는) 사용되지 않으며 .NET Android의 이후 버전에서 제거됩니다. 'XAJavaInterop1'을 사용하도록 프로젝트 속성을 업데이트하세요. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Android 애플리케이션 프로젝트에서 Android Wear 애플리케이션 프로젝트 '{0}'을(를) 참조하는 기능은 사용되지 않으며 Xamarin.Android의 이후 버전에서 더 이상 지원되지 않습니다. Android 애플리케이션 프로젝트에서 Android Wear 애플리케이션 프로젝트 참조를 제거하고 대신 Wear 애플리케이션을 독립 실행형 애플리케이션으로 배포하세요. + Android 애플리케이션 프로젝트에서 Android Wear 애플리케이션 프로젝트 '{0}'을(를) 참조하는 기능은 사용되지 않으며 .NET Android의 이후 버전에서 더 이상 지원되지 않습니다. Android 애플리케이션 프로젝트에서 Android Wear 애플리케이션 프로젝트 참조를 제거하고 대신 Wear 애플리케이션을 독립 실행형 애플리케이션으로 배포하세요. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing tool name - API 레벨 {0}의 android.jar을 찾을 수 없습니다. API 레벨 {0}의 Android SDK 플랫폼이 설치되어 있지 않습니다. Android SDK 관리자({2})에서 설치하거나, 설치된 API 버전을 대상으로 하도록 Xamarin.Android 프로젝트를 변경하세요.({1}이(가) 없습니다.) + API 수준 {0}에 대해 android.jar을 찾을 수 없습니다. 즉, API 수준 {0}에 대한 Android SDK 플랫폼이 설치되어 있지 않습니다. '{1}'에 있어야 합니다. +{2} +자세한 내용은 https://aka.ms/xa5207을 참조하세요. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - 도구 > Android SDK 관리자 열기... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - 도구 > Android > Android SDK 관리자... - This string is the location of a menu command in Visual Studio. + Android SDK 관리자에 설치하거나(도구 > Android > Android SDK 관리자...) 설치된 API 버전을 대상으로 하도록 .NET Android 프로젝트를 변경합니다. + This string is the instrucitons to install the component + + + `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"`을 실행하여 누락된 API 레벨을 설치하거나 설치된 API 버전을 대상으로 하는 프로젝트를 변경할 수 있습니다. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. 포함된 Wear 앱 패키지 이름이 핸드헬드 앱 패키지 이름과 다릅니다({0} != {1}). @@ -943,4 +947,8 @@ In this message, the term "handheld app" means "app for handheld devices." {0} - An Android Resource Identifier. + + Android 지원 라이브러리는 .NET 9 이상에서 지원되지 않습니다. AndroidX로 마이그레이션하세요. 자세한 내용은 https://aka.ms/xamarin/androidx 페이지를 참조하세요. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx index 31bcbfa681d..f795f7ff424 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pl.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Plik „LibraryProjectProperties” „{0}” znajduje się w katalogu nadrzędnym pośredniego katalogu wyjściowego projektu powiązań. Dostosuj ścieżkę tak, aby użyć oryginalnego pliku „project.properties” bezpośrednio z katalogu projektu biblioteki systemu Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Plik konfiguracji „{0}” zostanie zignorowany. Pliki konfiguracji platformy .NET nie są obsługiwane w projektach Xamarin.Android, których miejscem docelowym jest platforma .NET 6 lub nowsza. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Plik konfiguracji „{0}” zostanie zignorowany. Pliki konfiguracji platformy .NET nie są obsługiwane w projektach .NET dla systemu Android, których miejscem docelowym jest platforma .NET 6 lub nowsza. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Używanie narzędzia AAPT nie jest obsługiwane w projektach Xamarin.Android, których miejscem docelowym jest platforma .NET 6 lub nowsza. Włącz opcję „Użyj systemu przyrostowego tworzenia pakietów systemu Android (aapt2)” na stronach właściwości projektu w programie Visual Studio lub zmodyfikuj plik projektu w edytorze tekstów, ustawiając właściwość programu MSBuild o nazwie „AndroidUseAapt2” na wartość „true”. + Używanie narzędzia AAPT nie jest obsługiwane w projektach platformy .NET dla systemu Android przeznaczonych dla platformy .NET 6 lub nowszej. Włącz opcję „Użyj systemu przyrostowego tworzenia pakietów systemu Android (aapt2)” na stronach właściwości projektu w programie Visual Studio lub zmodyfikuj plik projektu w edytorze tekstów, ustawiając właściwość programu MSBuild o nazwie „AndroidUseAapt2” na wartość „true”. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Zmień wartość w pliku AndroidManifest.xml, aby odpowiadała wartości $(Suppo {1} - The SupportedOSPlatformVersion property value - Wykryto użycie metody AppDomain.CreateDomain() w zestawie: {0}. Platforma .NET 6 lub nowsza wersja obsługuje tylko jedną domenę aplikacji, dlatego ten interfejs API nie będzie już dostępny w rozszerzeniu Xamarin.Android po wydaniu platformy .NET 6. + Wykryto użycie metody AppDomain.CreateDomain() w zestawie: {0}. Platforma .NET 6 lub nowsza wersja obsługuje tylko jedną domenę aplikacji, dlatego ten interfejs API nie będzie już dostępny na platformie .NET dla systemu Android po wydaniu platformy .NET 6. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Wartość analizatora klas systemu Android „{0}” jest przestarzała i zostanie usunięta w przyszłej wersji rozszerzenia Xamarin.Android. Zaktualizuj właściwości projektu, aby używać literału „class-parse”. + Wartość analizatora klas systemu Android „{0}” jest przestarzała i zostanie usunięta w przyszłej wersji platformy .NET dla systemu Android. Zaktualizuj właściwości projektu, aby używać literału „class-parse”. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Element docelowy generowania kodu systemu Android „{0}” jest przestarzały i zostanie usunięty w przyszłej wersji rozszerzenia Xamarin.Android. Zaktualizuj właściwości projektu, aby używać literału „XAJavaInterop1”. + Element docelowy generowania kodu systemu Android „{0}” jest przestarzały i zostanie usunięty w przyszłej wersji platformy .NET dla systemu Android. Zaktualizuj właściwości projektu, aby używać literału „XAJavaInterop1”. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Odwoływanie się do projektu aplikacji dla systemu Android Wear „{0}” z projektu aplikacji dla systemu Android jest przestarzałe i nie będzie już obsługiwane w przyszłej wersji programu Xamarin.Android. Usuń odwołanie do projektu aplikacji dla systemu Android Wear z projektu aplikacji dla systemu Android i dystrybuuj aplikację dla systemu Wear jako autonomiczną aplikację. + Odwoływanie się do projektu aplikacji dla systemu Android Wear „{0}” z projektu aplikacji dla systemu Android jest przestarzałe i nie będzie już obsługiwane w przyszłej wersji platformy .NET dla systemu Android. Usuń odwołanie do projektu aplikacji dla systemu Android Wear z projektu aplikacji dla systemu Android i dystrybuuj aplikację dla systemu Wear jako autonomiczną aplikację. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Usuń odwołanie „{0}” z projektu i zamiast niego dodaj pakiet NuGet „{1} {0} - The missing tool name - Nie można było znaleźć pliku android.jar dla poziomu interfejsu API {0}. Oznacza to, że platforma Android SDK dla poziomu interfejsu API {0} nie jest zainstalowana. Zainstaluj ją w Menedżerze zestawów Android SDK ({2}) lub zmień projekt Xamarin.Android tak, aby był przeznaczony dla zainstalowanej wersji interfejsu API. (Brak pliku {1}). + Nie można odnaleźć pliku android.jar dla poziomu interfejsu API {0}. Oznacza to, że platforma zestawu Android SDK dla poziomu interfejsu API {0} nie jest zainstalowana. Oczekiwano, że będzie w „{1}”. +{2} +Aby uzyskać więcej informacji, zobacz https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Narzędzia > Otwórz Menedżer zestawów SDK dla systemu Android... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Narzędzia > Android > Menedżer zestawów Android SDK... - This string is the location of a menu command in Visual Studio. + Zainstaluj go w Menedżer zestawów Android SDK (Narzędzia > Android > Menedżer zestawów Android SDK...) lub zmień projekt platformy .NET dla systemu Android, tak aby był przeznaczony dla zainstalowanej wersji interfejsu API. + This string is the instrucitons to install the component + + + Brakujący poziom interfejsu API można zainstalować, uruchamiając polecenie „dotnet build -t:InstallAndroidDependencies -f {0} „-p:AndroidSdkDirectory={1}”” lub zmień projekt tak, aby był przeznaczony dla zainstalowanej wersji interfejsu API. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Nazwa pakietu osadzonej aplikacji systemu Wear jest inna niż nazwa pakietu aplikacji dla urządzenia podręcznego ({0} != {1}). @@ -943,4 +947,8 @@ Aby użyć niestandardowej ścieżki zestawu JDK dla kompilacji wiersza poleceni {0} - An Android Resource Identifier. + + Biblioteki pomocy technicznej systemu Android nie są obsługiwane na platformie .NET 9 i nowszych. Przeprowadź migrację do systemu AndroidX. Aby uzyskać więcej informacji, zobacz https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx index 1dd5676c7f7..90b270b82a4 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.pt-BR.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex O arquivo `LibraryProjectProperties` `{0}` está localizado em um diretório pai do diretório de saída intermediário do projeto de associações. Ajuste o caminho para usar o arquivo original `project.properties` diretamente no diretório do projeto de biblioteca do Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Ignorando o arquivo de configuração '{0}'. Não há suporte para arquivos de configuração do .NET em projetos Xamarin.Android direcionados ao .NET 6 ou posterior. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Ignorando o arquivo de configuração '{0}'. Não há suporte para os arquivos de configuração do .NET nos projetos Android do .NET direcionados ao .NET 6 ou superior. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Não há suporte para o uso de AAPT nos projetos Xamarin.Android direcionados ao .NET 6 ou superior. Habilite 'Usar o sistema de empacotamento Android incremental (aapt2)' nas páginas de propriedades do projeto do Visual Studio ou edite o arquivo de projeto em um editor de texto e defina a propriedade 'AndroidUseAapt2' do MSBuild como 'true'. + Não há suporte usar o AAPT nos projetos Xamarin.Android direcionados ao .NET 6 ou superior. Habilite 'Usar o sistema de empacotamento Android incremental (aapt2)' nas páginas de propriedades do projeto do Visual Studio ou edite o arquivo de projeto em um editor de texto e defina a propriedade 'AndroidUseAapt2' do MSBuild como 'true'. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Altere o valor no AndroidManifest.xml para corresponder ao valor $(SupportedOSPl {1} - The SupportedOSPlatformVersion property value - O uso de AppDomain.CreateDomain() foi detectado no assembly: {0}. O .NET 6 e superior dará suporte apenas a um único AppDomain, portanto, esta API não estará mais disponível no Xamarin.Android quando o .NET 6 for lançado. + O uso do AppDomain.CreateDomain() foi detectado no assembly: {0}. O .NET 6 e superior dará suporte apenas a um único AppDomain, portanto, essa API não estará mais disponível no Xamarin.Android quando o .NET 6 for lançado. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - O valor do analisador de classe do Android '{0}' foi preterido e será removido em uma versão futura do Xamarin.Android. Atualize as propriedades do projeto para usar 'class-parse'. + O valor do analisador de classe do Android '{0}' foi preterido e será removido em uma versão futura do .NET Android. Atualize as propriedades do projeto para usar 'class-parse'. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - O destino de geração de código Android '{0}' foi preterido e será removido em uma versão futura do Xamarin.Android. Atualize as propriedades do projeto para usar 'XAJavaInterop1'. + O destino de geração de código android '{0}' foi preterido e será removido em uma versão futura do .NET Android. Atualize as propriedades do projeto para usar 'XAJavaInterop1'. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - A referência ao projeto de aplicativo Wear Android '{0}' de um projeto de aplicativo Android foi preterida e não haverá mais suporte para ela em uma versão futura do Xamarin.Android. Remova a referência ao projeto de aplicativo Wear Android do projeto de aplicativo Android e distribua o aplicativo Wear como um aplicativo autônomo. + A referência ao projeto do aplicativo Android Wear '{0}' de um projeto de aplicativo Android foi preterida e não terá mais suporte em uma versão futura do .NET Android. Remova a referência ao projeto de aplicativo Wear Android do projeto de aplicativo Android e distribua o aplicativo Wear como um aplicativo autônomo. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Remover a referência '{0}' de seu projeto e adicionar o pacote NuGet '{1}' em v {0} - The missing tool name - Não foi possível encontrar android.jar para o nível da API {0}. Isso significa que a plataforma do SDK do Android para o nível da API {0} não está instalada. Instale-a no Gerenciador de SDK Android ({2}) ou altere o projeto Xamarin.Android para que ele seja direcionado a uma versão da API instalada. ({1} ausente.) + Não foi possível localizar android.jar no nível da API {0}. Isso significa que o SDK do Android no nível da API {0} não está instalado; era esperado que ele estivesse em '{1}'. +{2} +Consulte https://aka.ms/xa5207 para obter mais detalhes. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Ferramentas > Abrir o Gerenciador de SDK Android... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Ferramentas > Android > Gerenciador de SDK Android... - This string is the location of a menu command in Visual Studio. + Instale-o no Gerenciador de SDK Android (Ferramentas > Android > Gerenciador de SDK Android...) ou altere o projeto do Android .NET para direcionar a uma versão de API instalada. + This string is the instrucitons to install the component + + + Você pode instalar o nível de API ausente executando 'dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"' ou alterar o projeto para ter como destino uma versão de API instalada. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. O nome do pacote do aplicativo Wear inserido difere do nome do pacote do aplicativo portátil ({0} != {1}). @@ -943,4 +947,8 @@ Para usar um caminho JDK personalizado para um build de linha de comando, defina {0} - An Android Resource Identifier. + + Não há suporte para as bibliotecas de suporte do Android no .NET 9 e posterior; migre para o AndroidX. Para obter detalhes, confira https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index c591e39618f..09fb910bdeb 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex `LibraryProjectProperties` file `{0}` is located in a parent directory of the bindings project's intermediate output directory. Please adjust the path to use the original `project.properties` file directly from the Android library project directory. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Ignoring configuration file '{0}'. .NET configuration files are not supported in Xamarin.Android projects that target .NET 6 or higher. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Ignoring configuration file '{0}'. .NET configuration files are not supported in .NET Android projects that target .NET 6 or higher. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Using AAPT is not supported in Xamarin.Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'. + Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla {1} - The SupportedOSPlatformVersion property value - Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 6 is released. + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in .NET Android once .NET 6 is released. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - The Android class parser value '{0}' is deprecated and will be removed in a future version of Xamarin.Android. Update the project properties to use 'class-parse'. + The Android class parser value '{0}' is deprecated and will be removed in a future version of .NET Android. Update the project properties to use 'class-parse'. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - The Android code generation target '{0}' is deprecated and will be removed in a future version of Xamarin.Android. Update the project properties to use 'XAJavaInterop1'. + The Android code generation target '{0}' is deprecated and will be removed in a future version of .NET Android. Update the project properties to use 'XAJavaInterop1'. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Referencing the Android Wear application project '{0}' from an Android application project is deprecated and will no longer be supported in a future version of Xamarin.Android. Remove the Android Wear application project reference from the Android application project and distribute the Wear application as a standalone application instead. + Referencing the Android Wear application project '{0}' from an Android application project is deprecated and will no longer be supported in a future version of .NET Android. Remove the Android Wear application project reference from the Android application project and distribute the Wear application as a standalone application instead. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Remove the '{0}' reference from your project and add the '{1}' NuGet package ins {0} - The missing tool name - Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed. Either install it in the Android SDK Manager ({2}), or change the Xamarin.Android project to target an API version that is installed. ({1} missing.) + Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed; it was expected to be in `{1}`. +{2} +See https://aka.ms/xa5207 for more details. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Tools > Open Android SDK Manager... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Tools > Android > Android SDK Manager... - This string is the location of a menu command in Visual Studio. + Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the .NET Android project to target an API version that is installed. + This string is the instrucitons to install the component + + + You can install the missing API level by running `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"`, or change the project to target an API version that is installed. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Embedded Wear app package name differs from handheld app package name ({0} != {1}). @@ -943,4 +947,8 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS {0} - An Android Resource Identifier. + + 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. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx index 9092c451346..bb1b12237fa 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.ru.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex Файл "LibraryProjectProperties" "{0}" находится в родительском каталоге промежуточного выходного каталога проекта привязок. Измените путь, чтобы использовать исходный файл "project.properties" непосредственно из каталога проекта библиотеки Android. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - Пропуск файла конфигурации "{0}". Файлы конфигурации .NET не поддерживаются в проектах Xamarin.Android для .NET 6 и более поздних версиях. - The following are literal names and should not be translated: .NET, Xamarin.Android. + Пропуск файла конфигурации "{0}". Файлы конфигурации .NET не поддерживаются в проектах .NET Android для .NET 6 и более поздних версий. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - Использование AAPT не поддерживается в проектах Xamarin.Android для .NET 6 и более поздних версий. Установите параметр "Использование инкрементной системы создания пакетов Android (AAPT2)" на страницах свойств проекта в Visual Studio или откройте файл проекта в текстовом редакторе и задайте значение "true" для свойства MSBuild "AndroidUseAapt2". + Использование AAPT не поддерживается в проектах .NET Android для .NET 6 и более поздних версий. Установите параметр "Использование инкрементной системы создания пакетов Android (AAPT2)" на страницах свойств проекта в Visual Studio или откройте файл проекта в текстовом редакторе и задайте значение "true" для свойства MSBuild "AndroidUseAapt2". The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ In this message, the term "binding" means a piece of generated code that makes i {1} - The SupportedOSPlatformVersion property value - В сборке обнаружено использование AppDomain.CreateDomain(): {0}. .NET 6 и более поздние версии будут поддерживать только один домен AppDomain, поэтому этот API больше не будет доступен в Xamarin.Android после выпуска .NET 6. + В сборке обнаружено использование AppDomain.CreateDomain(): {0}. .NET 6 и более поздние версии будут поддерживать только один домен AppDomain, поэтому этот API больше не будет доступен в .NET Android после выпуска .NET 6. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Значение "{0}" синтаксического анализатора класса Android является устаревшим и будет удалено в следующей версии Xamarin.Android. Обновите свойства проекта, чтобы использовать "class-parse". + Значение "{0}" синтаксического анализатора класса Android является устаревшим и будет удалено в будущей версии .NET Android. Обновите свойства проекта, чтобы использовать "class-parse". The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Целевой объект "{0}" создания кода Android является устаревшим и будет удален в следующей версии Xamarin.Android. Обновите свойства проекта, чтобы использовать "XAJavaInterop1". + Целевой объект "{0}" создания кода Android является устаревшим и будет удален в следующей версии .NET Android. Обновите свойства проекта, чтобы использовать "XAJavaInterop1". The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Использование ссылки на проект приложения Android Wear "{0}" из проекта приложения Android является нерекомендуемым, и в будущей версии Xamarin.Android поддержка такой ссылки будет прекращена. Удалите ссылку на проект приложения Android Wear из проекта приложения Android и распространяйте приложение Wear в качестве автономного приложения. + Использование ссылки на проект приложения Android Wear "{0}" из проекта приложения Android является нерекомендуемым, и в будущей версии .NET Android поддержка такой ссылки будет прекращена. Удалите ссылку на проект приложения Android Wear из проекта приложения Android и распространяйте приложение Wear в качестве автономного приложения. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing tool name - Не удалось найти файл android.jar для уровня API {0}. Это означает, что платформа SDK для Android для уровня API {0} не установлена. Установите его в Диспетчере SDK Android ({2}) или измените проект Xamarin.Android, чтобы установленная версия API использовалась в нем в качестве целевой. (Отсутствует файл {1}.) + Не удалось найти android.jar для уровня API {0}. Это означает, что платформа Android SDK для уровня API {0} не установлена. Ожидалось ее нахождение в "{1}". +{2} +Дополнительные сведения см. на странице https://aka.ms/xa5207. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Средства > Открыть Диспетчер SDK Android… - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Средства > Android > Диспетчер SDK Android… - This string is the location of a menu command in Visual Studio. + Установите его в Диспетчере SDK Android (Инструменты > Android > Диспетчер SDK Android...) или измените проект .NET Android, выбрав для него в качестве цели установленную версию API. + This string is the instrucitons to install the component + + + Вы можете установить отсутствующий уровень API, выполнив команду "dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"" или изменив проект путем выбора установленной версии API в качестве цели. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Имя пакета приложения Wear для встроенных устройств отличается от имени пакета приложения для наладонных устройств ({0} != {1}). @@ -943,4 +947,8 @@ In this message, the term "handheld app" means "app for handheld devices." {0} - An Android Resource Identifier. + + Библиотеки поддержки Android не поддерживаются в .NET 9 и более поздних версиях. Перейдите на AndroidX. Дополнительные сведения: https://aka.ms/xamarin/androidx. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx index d194aea0bc5..cb9c791d71c 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.tr.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex `LibraryProjectProperties` dosyası `{0}`, bağlama projesinin ara çıkış dizininin bir üst dizininde yer alıyor. Lütfen yolu özgün `project.properties` dosyasını doğrudan Android kitaplığı proje dizininden kullanacak şekilde ayarlayın. The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - '{0}' yapılandırma dosyası yoksayılıyor. .NET yapılandırma dosyaları, .NET 6 veya üstünü hedefleyen Xamarin.Android projelerinde desteklenmiyor. - The following are literal names and should not be translated: .NET, Xamarin.Android. + '{0}' yapılandırma dosyası göz ardı ediliyor. .NET yapılandırma dosyaları, .NET 6 veya üstünü hedefleyen .NET Android projelerinde desteklenmez. + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - .NET 6 veya üstünü hedefleyen Xamarin.Android projelerinde AAPT kullanımı desteklenmiyor. Lütfen Visual Studio projesinin özellik sayfalarındaki 'Artımlı Android paketleme sistemini (aapt2) kullan' seçeneğini etkinleştirin veya proje dosyasını bir metin düzenleyicisinde düzenleyip 'AndroidUseAapt2' MSBuild özelliğini 'true' olarak ayarlayın. + .NET 6 veya üstünü hedefleyen .NET Android projelerinde AAPT kullanımı desteklenmez. Lütfen Visual Studio projesinin özellik sayfalarındaki 'Artımlı Android paketleme sistemini (aapt2) kullan' seçeneğini etkinleştirin veya proje dosyasını bir metin düzenleyicisinde düzenleyip 'AndroidUseAapt2' MSBuild özelliğini 'true' olarak ayarlayın. The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ AndroidManifest.xml dosyasındaki değeri $(SupportedOSPlatformVersion) değeriy {1} - The SupportedOSPlatformVersion property value - {0} bütünleştirilmiş kodunda AppDomain.CreateDomain() metodunun kullanıldığı saptandı. .NET 6 üstünde yalnızca tek bir AppDomain destekleneceğinden bu API, .NET 6 yayımlandıktan sonra artık Xamarin.Android içinde bulunmayacaktır. + Derlemede AppDomain.CreateDomain() kullanımı algılandı: {0}. .NET 6 ve üzeri yalnızca tek bir AppDomain'i destekleyeceğinden, .NET 6 yayımlandıktan sonra bu API artık .NET Android'de kullanılamayacaktır. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - '{0}' Android sınıf ayrıştırıcı değeri kullanımdan kaldırıldı ve Xamarin.Android'in gelecekteki bir sürümünde kaldırılacak. Proje özelliklerini 'class-parse' kullanacak şekilde güncelleştirin. + Android sınıfı ayrıştırıcı değeri '{0}' kullanımdan kaldırıldı ve .NET Android'in gelecekteki bir sürümünde kaldırılacak. Proje özelliklerini 'class-parse' kullanacak şekilde güncelleştirin. The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - '{0}' Android kod oluşturma hedefi kullanımdan kaldırıldı ve Xamarin.Android'in gelecekteki bir sürümünde kaldırılacak. Proje özelliklerini 'XAJavaInterop1' kullanacak şekilde güncelleştirin. + Android kod oluşturma hedefi '{0}' kullanımdan kaldırıldı ve .NET Android'in gelecekteki bir sürümünde kaldırılacak. Proje özelliklerini 'XAJavaInterop1' kullanacak şekilde güncelleştirin. The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - Android uygulama projesinden '{0}' Android Wear uygulama projesine başvurulması kullanımdan kaldırıldı ve artık Xamarin.Android'in gelecekteki sürümlerinde desteklenmeyecek. Android uygulama projesinden Android Wear uygulama projesi başvurusunu kaldırın ve bunun yerine Wear uygulamasını bağımsız bir uygulama olarak dağıtın. + Bir Android uygulama projesinden Android Wear uygulama projesine '{0}' başvurmak artık kullanımdan kaldırıldı ve .NET Android'in gelecekteki bir sürümünde artık desteklenmeyecek. Android Wear uygulama projesi referansını Android uygulama projesinden kaldırın ve bunun yerine Wear uygulamasını bağımsız bir uygulama olarak dağıtın. The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ Projenizden '{0}' başvurusunu kaldırın ve yerine '{1}' NuGet paketini ekleyin {0} - The missing tool name - API düzeyi {0} için android.jar bulunamadı. Bu, API düzeyi {0} için Android SDK platformunun yüklü olmadığı anlamına gelir. Bu platformu Android SDK Yöneticisi'nde ({2}) yükleyin veya Xamarin.Android projesini, yüklü bir API sürümünü hedefleyecek şekilde değiştirin. ({1} eksik.) + {0} API düzeyi için android.jar bulunamadı . Bu, {0} API düzeyi için Android SDK platformunun kurulu olmadığı anlamına gelir; `{1}`de olması bekleniyordu. +{2} +Daha fazla ayrıntı için https://aka.ms/xa5207 adresine bakın. The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - Araçlar > Android SDK Yöneticisi'ni Aç... - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - Araçlar > Android > Android SDK Yöneticisi... - This string is the location of a menu command in Visual Studio. + Bunu Android SDK Yöneticisi'ne yükleyin (Araçlar > Android > Android SDK Yöneticisi...) veya .NET Android projesini, yüklü bir API sürümünü hedefleyecek şekilde değiştirin. + This string is the instrucitons to install the component + + + Eksik API düzeyini `dotnet build -t:InstallAndroidDependegency -f {0} "-p:AndroidSdkDirectory={1}"` komutunu çalıştırarak yükleyebilir veya yüklü olan bir API sürümünü hedefleyecek şekilde projeyi değiştirebilirsiniz. + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. Eklenmiş Wear uygulama paketi adı, el bilgisayarı uygulama paketi adından farklı ({0} != {1}). @@ -943,4 +947,8 @@ Bir komut satırı derlemesi için özel bir SDK yolu kullanmak için 'JavaSdkDi {0} - An Android Resource Identifier. + + Android Destek kitaplıkları .NET 9 ve sonraki sürümlerde desteklenmiyor, lütfen AndroidX'e geçin. Daha fazla ayrıntı için https://aka.ms/xamarin/androidx adresini ziyaret edin. + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx index b02794b3f15..41f60195732 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hans.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex "LibraryProjectProperties" 文件“{0}”位于绑定项目的中间输出目录的父目录中。请调整路径,以直接从 Android 库项目目录使用原始 "project.properties" 文件。 The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - 将忽略配置文件“{0}”。在面向 .NET 6 或更高版本的 Xamarin.Android 项目中不支持 .NET 配置文件。 - The following are literal names and should not be translated: .NET, Xamarin.Android. + 将忽略配置文件“{0}”。在面向 .NET 6 或更高版本的 .NET Android 项目中不支持 .NET 配置文件。 + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - 在面向 .NET 6 或更高版本的 Xamarin.Android 项目中不支持使用 AAPT。请在 Visual Studio 项目属性页面中启用“使用增量 Android 打包系统(aapt2)”,或者在文本编辑器中编辑项目文件,并将 "AndroidUseAapt2" MSBuild 属性设置为 "true"。 + 在面向 .NET 6 或更高版本的 .NET Android 项目中不支持使用 AAPT。请在 Visual Studio 项目属性页面中启用“使用增量 Android 打包系统(aapt2)”,或者在文本编辑器中编辑项目文件,并将 "AndroidUseAapt2" MSBuild 属性设置为 "true"。 The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ In this message, the term "binding" means a piece of generated code that makes i {1} - The SupportedOSPlatformVersion property value - 在程序集 {0} 中检测到使用了 AppDomain.CreateDomain()。.NET 6 及更高版本将仅支持一个 AppDomain,因此 .NET 6 发布后,将无法再在 Xamarin.Android 中使用此 API。 + 在程序集 {0} 中检测到使用了 AppDomain.CreateDomain()。.NET 6 及更高版本将仅支持一个 AppDomain,因此 .NET 6 发布后,将无法再在 .NET Android 中使用此 API。 The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Android 类分析器值“{0}”已被弃用,并将在 Xamarin.Android 的未来版本中被删除。要使用 "class-parse",请更新项目属性。 + Android 类分析器值“{0}”已被弃用,并将在 .NET Android 的未来版本中被删除。要使用 "class-parse",请更新项目属性。 The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Android 代码生成目标“{0}”已被弃用,并将在 Xamarin.Android 的未来版本中被删除。要使用 "XAJavaInterop1",请更新项目属性。 + Android 代码生成目标“{0}”已被弃用,并将在 .NET Android 的未来版本中被删除。要使用 "XAJavaInterop1",请更新项目属性。 The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - 已弃用从 Android 应用程序项目中引用 Android Wear 应用程序项目“{0}”的功能,并且未来版本的 Xamarin.Android 中将不再支持此功能。请从 Android 应用程序项目中删除 Android Wear 应用程序项目引用,并将 Wear 应用程序作为独立应用程序进行分发。 + 已弃用从 Android 应用程序项目中引用 Android Wear 应用程序项目“{0}”的功能,并且未来版本的 .NET Android 中将不再支持此功能。请从 Android 应用程序项目中删除 Android Wear 应用程序项目引用,并将 Wear 应用程序作为独立应用程序进行分发。 The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing tool name - 找不到 API 级别 {0} 的 android jar。这意味着未安装 API 级别 {0} 的 Android SDK 平台。请在 Android SDK 管理器 {2} 中安装它,或更改 Xamarin.Android 项目,使其将安装的 API 版本作为目标。(缺少 {1}。) + 找不到适用于 API 级别 {0} 的 android.jar。这意味着适用于 API 级别 {0} 的 Android SDK 平台未安装;它应位于 `{1}` 中。 +{2} +有关更多详细信息,请参阅 https://aka.ms/xa5207。 The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - “工具”>“打开 Android SDK 管理器”… - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - “工具”>“ Android”>“Android SDK 管理器”… - This string is the location of a menu command in Visual Studio. + 要么将其安装在 Android SDK 管理器中(工具 > Android > Android SDK 管理器...),要么将 .NET Android 项目更改为面向已安装的 API 版本。 + This string is the instrucitons to install the component + + + 可以通过运行 `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"` 来安装缺少的 API 级别,或将项目更改为面向已安装的 API 版本。 + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. 嵌入的 Wear 应用包名称与手持式应用包名称不同({0} != {1})。 @@ -943,4 +947,8 @@ In this message, the term "handheld app" means "app for handheld devices." {0} - An Android Resource Identifier. + + .NET 9 及更高版本不支持 Android 支持库,请迁移到 AndroidX。有关详细信息,请参阅 https://aka.ms/xamarin/androidx。 + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx index a5f5014da91..d953e20c7df 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.zh-Hant.resx @@ -416,7 +416,7 @@ The capitalized word "Portable" that appears earlier in the message is plain tex 'LibraryProjectProperties' 檔案 '{0}' 位於繫結專案之中繼輸出目錄的父目錄中。請將該路徑調整為直接使用 Android 程式庫專案目錄中的原始 'project. properties' 檔案。 The following are literal names and should not be translated: LibraryProjectProperties, project.properties, Android -In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a Xamarin.Android project written in C# or F#. +In this message, the term "binding" means a piece of generated code that makes it easy to access an Android API written in Java from a .NET Android project written in C# or F#. {0} - The path of the LibraryProjectProperties file @@ -438,8 +438,8 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: DX, DEX, d8, AndroidDexTool. - 正在忽略組態檔 '{0}'。以 .NET 6 或更新版本為目標的 Xamarin.Android 專案不支援 .NET 組態檔。 - The following are literal names and should not be translated: .NET, Xamarin.Android. + 正在忽略組態檔 '{0}'。以 .NET 6 或更新版本為目標的 .NET Android 專案不支援 .NET 組態檔。 + The following are literal names and should not be translated: .NET, .NET Android. {0} - The file name such as 'Foo.dll.config' @@ -451,7 +451,7 @@ In this message, the term "binding" means a piece of generated code that makes i The following are literal names and should not be translated: AAPT, AAPT2, Android, AndroidUseAapt2, true. - 以 .NET 6 或更新版本為目標的 Xamarin.Android 專案不支援使用 AAPT。請在 Visual Studio 專案屬性頁中啟用 [使用增量 Android 套件系統 (aapt2)],或在文字編輯器中編輯專案檔,並將 'AndroidUseAapt2' MSBuild 屬性設定為 'true'。 + 以 .NET 6 或更新版本為目標的 .NET Android 專案不支援使用 AAPT。請在 Visual Studio 專案屬性頁中啟用 [使用增量 Android 套件系統 (aapt2)],或在文字編輯器中編輯專案檔,並將 'AndroidUseAapt2' MSBuild 屬性設定為 'true'。 The following are literal names and should not be translated: AAPT, Android, AndroidUseAapt2, true. @@ -505,7 +505,7 @@ In this message, the term "binding" means a piece of generated code that makes i {1} - The SupportedOSPlatformVersion property value - 在下列組件中偵測到使用 AppDomain.CreateDomain(): {0}。.NET 6 及更新版本只支援單一 AppDomain,因此在 .NET 6 發行之後,此 API 就無法再於 Xamarin.Android 中使用。 + 在下列組件中偵測到使用 AppDomain.CreateDomain(): {0}。.NET 6 及更新版本只支援單一 AppDomain,因此在 .NET 6 發行之後,此 API 就無法再於 .NET Android 中使用。 The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain {0} - The name of the assembly @@ -704,12 +704,12 @@ In this message, "root element" refers to the root element of an XML file. {0} - The exception message and stack trace of the associated exception - Android 類別剖析器值 '{0}' 即將退場,將會從後續版本的 Xamarin.Android 版本中移除。請更新專案屬性,以使用 'class-parse'。 + Android 類別剖析器值 '{0}' 即將退場,將會從後續版本的 .NET Android 版本中移除。請更新專案屬性,以使用 'class-parse'。 The following are literal names and should not be translated: class-parse {0} - The name of the current class parser value - Android 程式碼產生目標 '{0}' 即將退場,將會從後續版本的 Xamarin.Android 版本中移除。請更新專案屬性,以使用 'XAJavaInterop1'。 + Android 程式碼產生目標 '{0}' 即將退場,將會從後續版本的 .NET Android 版本中移除。請更新專案屬性,以使用 'XAJavaInterop1'。 The following are literal names and should not be translated: XAJavaInterop1 {0} - The name of the current code generation target @@ -790,7 +790,7 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi "Wear" is a short version of the full product name "Wear OS" and so should not be translated. - 從 Android 應用程式專案參考 Android Wear 應用程式專案 '{0}' 的功能已淘汰,且日後的 Xamarin.Android 版本將不再予以支援。從 Android 應用程式專案移除 Android Wear 應用程式專案參考,並將 Wear 應用程式改為以獨立應用程式發佈。 + 從 Android 應用程式專案參考 Android Wear 應用程式專案 '{0}' 的功能已淘汰,且日後的 .NET Android 版本將不再予以支援。從 Android 應用程式專案移除 Android Wear 應用程式專案參考,並將 Wear 應用程式改為以獨立應用程式發佈。 The following are literal names and should not be translated: Android Wear, Android, Wear. {0} - The referenced Android Wear project. @@ -861,19 +861,23 @@ The following are literal names and should not be translated: ABI, 'libs/armeabi {0} - The missing tool name - 找不到 API 層級 {0} 的 android.jar。這表示未安裝 API 層級 {0} 的 Android SDK 平台。請將其安裝在 Android SDK 管理員 ({2}) 中,或將 Xamarin.Android 專案變更成以已安裝的 API 版本作為目標。(缺少 {1}。) + 找不到 API 層級 {0} 的 android.jar。這表示未安裝 API 層級的 Android SDK {0}; 該平台應位於 `{1}` 中。 +{2} +如需詳細資料,請參閱 https://aka.ms/xa5207。 The following are literal names and should not be translated: android.jar {0} - The API level name {1} - The expected path of the android.jar file -{2} - The menu location in Visual Studio that can be used to launch the Android SDK Manager - - - [工具] > [開啟 Android SDK 管理員...] - This string is the location of a menu command in Visual Studio for Mac. +{2} - The instructions to install the missing component - [工具] > [Android] > [Android SDK 管理員...] - This string is the location of a menu command in Visual Studio. + 請將其安裝在 Android SDK 管理員中 (工具 > Android > Android SDK 管理員...),或將 .NET Android 專案變更為針對已安裝的 API 版本為目標。 + This string is the instrucitons to install the component + + + 您可以執行 `dotnet build -t:InstallAndroidDependencies -f {0} "-p:AndroidSdkDirectory={1}"` 來安裝遺失的 API 層級,或將專案變更為針對已安裝的 API 版本為目標。 + This string is the instrucitons to install the component +{0} - The TargetFramework the app is targeting. +{1} - The current AndroidSdkDirectory path. 內嵌 Wear 應用程式套件名稱與手持功能應用程式套件名稱不同 ({0} != {1})。 @@ -943,4 +947,8 @@ In this message, the term "handheld app" means "app for handheld devices." {0} - An Android Resource Identifier. + + .NET 9 及更新版本不支援 Android 支持連結庫,請移轉至 AndroidX。如需詳細資料,請參閱 https://aka.ms/xamarin/androidx。 + The following are literal names and should not be translated: Android Support, AndroidX, .NET. + \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs index 1c51cb5980e..7f35ba57894 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Aapt2.cs @@ -541,7 +541,8 @@ static string GetErrorCode (string message) Tuple.Create ("APT2262", "unexpected element found in "), Tuple.Create ("APT2263", "found in "), // unexpected element found in Tuple.Create ("APT2264", "The system cannot find the file specified. (2)"), // Windows Long Path error from aapt2 - Tuple.Create ("APT2265", "The system cannot find the file specified. (2)") // Windows non-ASCII characters error from aapt2 + Tuple.Create ("APT2265", "The system cannot find the file specified. (2)"), // Windows non-ASCII characters error from aapt2 + Tuple.Create ("APT2266", "in tag has value of") // error: attribute ‘android:path’ in tag has value of ‘code/fooauth://com.foo.foo, it must start with a leading slash ‘/’. }; } } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs b/src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs index 2f7f199111c..5739e3cf40d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/CheckDuplicateJavaLibraries.cs @@ -9,16 +9,12 @@ namespace Xamarin.Android.Tasks { public class CheckDuplicateJavaLibraries : AndroidTask { - readonly static string [] ExcludedFiles = new [] { - "classes.jar", - "r-classes.jar", - }; - public override string TaskPrefix => "CDJ"; public ITaskItem [] JavaSourceFiles { get; set; } public ITaskItem[] JavaLibraries { get; set; } public ITaskItem[] LibraryProjectJars { get; set; } + public string [] ExcludedFiles { get; set; } public override bool RunTask () { diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.BindingGenerator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.BindingGenerator.cs index fd9c73a4298..b404d91156e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.BindingGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.BindingGenerator.cs @@ -127,6 +127,8 @@ public State BeginPartialClassFile (StreamWriter writer, string bindingClassName return state; } + public abstract void SetCodeBehindDir (string path); + protected abstract void BeginPartialClassFile (State state, string classNamespace, string className); public abstract void EndPartialClassFile (State state); public abstract void WritePartialClassProperty (State state, LayoutWidget widget); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.CSharpBindingGenerator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.CSharpBindingGenerator.cs index c5dc083427d..bc2b9ff6db4 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.CSharpBindingGenerator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.CSharpBindingGenerator.cs @@ -1,6 +1,8 @@ using System; using System.IO; using System.Linq; +using Xamarin.Android.Tasks.LLVMIR; +using Xamarin.Android.Tools; namespace Xamarin.Android.Tasks { @@ -10,6 +12,7 @@ sealed class CSharpBindingGenerator : BindingGenerator { const string BindingPartialClassBackingFieldName = "__layout_binding"; + string codebehindDir = string.Empty; protected override string LineCommentString => "//"; protected override string DocCommentString => "///"; public override string LanguageName => "C#"; @@ -28,6 +31,11 @@ protected override void BeginPartialClassFile (State state, string classNamespac state.WriteLine (); } + public override void SetCodeBehindDir(string path) + { + codebehindDir = Path.GetFullPath (path); + } + public override void EndPartialClassFile (State state) { EndBindingFile (state); // currently they're identical @@ -239,7 +247,8 @@ protected override void WriteLocationDirective (State state, LayoutWidget widget if (loc == null) return; - WriteLineIndent (state, $"#line {loc.Line} \"{loc.FilePath}\""); + var relativePath = PathUtil.GetRelativePath (codebehindDir, Path.GetFullPath (loc.FilePath)); + WriteLineIndent (state, $"#line {loc.Line} \"{relativePath}\""); state.WriteLine (); } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.cs index 161fc7e374c..1c721326b42 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GenerateLayoutBindings.cs @@ -107,6 +107,8 @@ public async override System.Threading.Tasks.Task RunTaskAsync () return; } + generator.SetCodeBehindDir (MonoAndroidCodeBehindDir); + LogDebugMessage ($"Generating {generator.LanguageName} binding sources"); var layoutGroups = new Dictionary (StringComparer.Ordinal); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs index 670fcfe566e..b5d86f9427e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs @@ -262,9 +262,16 @@ void AddEnvironment () HashSet archAssemblyNames = null; HashSet uniqueAssemblyNames = new HashSet (StringComparer.OrdinalIgnoreCase); Action updateAssemblyCount = (ITaskItem assembly) => { - // We need to use the 'RelativePath' metadata, if found, because it will give us the correct path for satellite assemblies - with the culture in the path. - string? relativePath = assembly.GetMetadata ("RelativePath"); - string assemblyName = String.IsNullOrEmpty (relativePath) ? Path.GetFileName (assembly.ItemSpec) : relativePath; + string? culture = MonoAndroidHelper.GetAssemblyCulture (assembly); + string fileName = Path.GetFileName (assembly.ItemSpec); + tring assemblyName; + + if (String.IsNullOrEmpty (culture)) { + assemblyName = fileName; + } else { + assemblyName = $"{culture}/{fileName}"; + } + if (!uniqueAssemblyNames.Contains (assemblyName)) { uniqueAssemblyNames.Add (assemblyName); } diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs index 33a9cad54cc..9744f864c4c 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/Generator.cs @@ -52,6 +52,7 @@ public class BindingsGenerator : AndroidDotnetToolTask public bool EnableBindingNestedInterfaceTypes { get; set; } public bool EnableBindingInterfaceConstants { get; set; } public string EnableRestrictToAttributes { get; set; } + public bool EnableObsoleteOverrideInheritance { get; set; } public string Nullable { get; set; } public ITaskItem[] TransformFiles { get; set; } @@ -217,6 +218,9 @@ protected override string GenerateCommandLineCommands () if (EnableBindingStaticAndDefaultInterfaceMethods) features.Add ("default-interface-methods"); + if (!EnableObsoleteOverrideInheritance) + features.Add ("do-not-fix-obsolete-overrides"); + if (string.Equals (EnableRestrictToAttributes, "obsolete", StringComparison.OrdinalIgnoreCase)) features.Add ("restrict-to-attributes"); diff --git a/src/Xamarin.Android.Build.Tasks/Tasks/GetJavaPlatformJar.cs b/src/Xamarin.Android.Build.Tasks/Tasks/GetJavaPlatformJar.cs index 171913f78e3..cb9b22f88da 100644 --- a/src/Xamarin.Android.Build.Tasks/Tasks/GetJavaPlatformJar.cs +++ b/src/Xamarin.Android.Build.Tasks/Tasks/GetJavaPlatformJar.cs @@ -25,8 +25,14 @@ public class GetJavaPlatformJar : AndroidTask public bool DesignTimeBuild { get; set; } + public bool BuildingInsideVisualStudio { get; set; } + public string SupportedOSPlatformVersion { get; set; } + public string TargetFramework { get; set; } + + public string AndroidSdkDirectory { get; set; } + [Output] public string JavaPlatformJarPath { get; set; } @@ -95,7 +101,9 @@ public override bool RunTask () } platform = GetTargetSdkVersion (platform, target_sdk); - JavaPlatformJarPath = MonoAndroidHelper.TryGetAndroidJarPath (Log, platform, designTimeBuild: DesignTimeBuild); + JavaPlatformJarPath = MonoAndroidHelper.TryGetAndroidJarPath (Log, platform, + designTimeBuild: DesignTimeBuild, buildingInsideVisualStudio: BuildingInsideVisualStudio, + targetFramework: TargetFramework, androidSdkDirectory: AndroidSdkDirectory); TargetSdkVersion = MonoAndroidHelper.SupportedVersions.GetApiLevelFromId (platform).ToString (); if (JavaPlatformJarPath == null) return !Log.HasLoggedErrors; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs index c653639bfd0..99e9a963422 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs @@ -1247,9 +1247,9 @@ protected override void OnCreate (Bundle bundle) proj.SetProperty ("AndroidGenerateLayoutBindings", "True"); using (var builder = CreateApkBuilder (path)) { Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); - FileAssert.Exists (Path.Combine (Root, path, proj.IntermediateOutputPath, "generated", "Binding.Main.g.cs")); + FileAssert.Exists (Path.Combine (Root, path, proj.IntermediateOutputPath, "codebehind", "Binding.Main.g.cs")); Assert.IsTrue (builder.Build (proj), "Second build should have succeeded."); - FileAssert.Exists (Path.Combine (Root, path, proj.IntermediateOutputPath, "generated", "Binding.Main.g.cs")); + FileAssert.Exists (Path.Combine (Root, path, proj.IntermediateOutputPath, "codebehind", "Binding.Main.g.cs")); } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs index 70e42e8c71f..b98cc2951ab 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs @@ -534,6 +534,8 @@ public void AppWithSingleJar () var builder = CreateApkBuilder (); Assert.IsTrue (builder.Build (proj), "first build should succeed"); + Assert.IsTrue (builder.DesignTimeBuild (proj), "Design time build should succeed."); + Assert.IsFalse (builder.Output.IsTargetSkipped ("AddBindingsToCompile"), "AddBindingsToCompile should run."); var assemblyPath = Path.Combine (Root, builder.ProjectDirectory, proj.OutputPath, $"{proj.ProjectName}.dll"); var typeName = "Com.Xamarin.Android.Test.Msbuildtest.JavaSourceJarTest"; @@ -778,31 +780,45 @@ public void LibraryProjectZipWithLint () } /// - /// Tests two .aar files with r-classes.jar + /// Tests two .aar files with r-classes.jar, repackaged.jar /// [Test] - public void AarWithRClassesJar () + public void CheckDuplicateJavaLibraries () { var path = Path.Combine ("temp", TestName); var lib1 = new XamarinAndroidBindingProject { ProjectName = "Library1", AndroidClassParser = "class-parse", Jars = { + // r-classes.jar new AndroidItem.LibraryProjectZip ("Library1.aar") { BinaryContent = () => ResourceData.Library1Aar - } + }, + // repackaged.jar + new AndroidItem.AndroidLibrary ("emoji2-1.4.0.aar") { + MetadataValues = "Bind=false", + WebContent = "https://maven.google.com/androidx/emoji2/emoji2/1.4.0/emoji2-1.4.0.aar", + }, }, }; var lib2 = new XamarinAndroidBindingProject { ProjectName = "Library2", AndroidClassParser = "class-parse", Jars = { + // r-classes.jar new AndroidItem.LibraryProjectZip ("Library2.aar") { BinaryContent = () => ResourceData.Library2Aar - } + }, + // repackaged.jar + new AndroidItem.AndroidLibrary ("connect-client-1.1.0-alpha07.aar") { + MetadataValues = "Bind=false", + WebContent = "https://maven.google.com/androidx/health/connect/connect-client/1.1.0-alpha07/connect-client-1.1.0-alpha07.aar", + }, }, }; - var app = new XamarinAndroidApplicationProject (); + var app = new XamarinAndroidApplicationProject { + SupportedOSPlatformVersion = "30", // androidx.health requires minSdkVersion="30" + }; app.AddReference (lib1); app.AddReference (lib2); using (var lib1Builder = CreateDllBuilder (Path.Combine (path, lib1.ProjectName))) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs index ba570cce8ca..f30f2f2388d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.TestCaseSource.cs @@ -124,7 +124,7 @@ public partial class BuildTest : BaseTest /* debugSymbols */ true , /* optimize */ true , /* embedassebmlies */ false , - /* expectedResult */ CommercialBuildAvailable ? "debug" : "release", + /* expectedResult */ TestEnvironment.CommercialBuildAvailable ? "debug" : "release", }, new object[] { /* supportedAbi */ "armeabi-v7a", @@ -145,7 +145,7 @@ public partial class BuildTest : BaseTest /* debugSymbols */ false , /* optimize */ null , /* embedassebmlies */ null , - /* expectedResult */ CommercialBuildAvailable ? "debug" : "release", + /* expectedResult */ TestEnvironment.CommercialBuildAvailable ? "debug" : "release", }, }; #pragma warning restore 414 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 9405f155328..e8dde8d8c3d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -139,12 +139,12 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease, bool aot, bo Assert.AreEqual (XABuildConfig.AndroidDefaultTargetDotnetApiLevel.ToString(), uses_sdk.Attribute (ns + "targetSdkVersion").Value); - bool expectEmbeddedAssembies = !(CommercialBuildAvailable && !isRelease); + bool expectEmbeddedAssembies = !(TestEnvironment.CommercialBuildAvailable && !isRelease); var apkPath = Path.Combine (outputPath, $"{proj.PackageName}-Signed.apk"); FileAssert.Exists (apkPath); var helper = new ArchiveAssemblyHelper (apkPath, usesAssemblyStore, rids); helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.dll", shouldContainEntry: expectEmbeddedAssembies); - helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.pdb", shouldContainEntry: !CommercialBuildAvailable && !isRelease); + helper.AssertContainsEntry ($"assemblies/{proj.ProjectName}.pdb", shouldContainEntry: !TestEnvironment.CommercialBuildAvailable && !isRelease); helper.AssertContainsEntry ($"assemblies/Mono.Android.dll", shouldContainEntry: expectEmbeddedAssembies); helper.AssertContainsEntry ($"assemblies/es/{proj.ProjectName}.resources.dll", shouldContainEntry: expectEmbeddedAssembies); foreach (var abi in rids.Select (AndroidRidAbiHelper.RuntimeIdentifierToAbi)) { @@ -801,7 +801,7 @@ public void BuildInDesignTimeMode ([Values(false, true)] bool useManagedParser) } [Test] - public void IfAndroidJarDoesNotExistThrowXA5207 () + public void IfAndroidJarDoesNotExistThrowXA5207 ([Values(true, false)] bool buildingInsideVisualStudio) { var path = Path.Combine ("temp", TestName); var AndroidSdkDirectory = CreateFauxAndroidSdkDirectory (Path.Combine (path, "android-sdk"), "24.0.1", new ApiInfo [] { new ApiInfo { Id = "30" } }); @@ -814,6 +814,7 @@ public void IfAndroidJarDoesNotExistThrowXA5207 () if (!Builder.UseDotNet) proj.TargetFrameworkVersion = builder.LatestTargetFrameworkVersion (); builder.ThrowOnBuildFailure = false; + builder.BuildingInsideVisualStudio = buildingInsideVisualStudio; Assert.IsTrue (builder.DesignTimeBuild (proj), "DesignTime build should succeed."); Assert.IsFalse (builder.LastBuildOutput.ContainsText ("error XA5207:"), "XA5207 should not have been raised."); builder.Target = "AndroidPrepareForBuild"; @@ -823,6 +824,10 @@ public void IfAndroidJarDoesNotExistThrowXA5207 () }), "Build should have failed"); Assert.IsTrue (builder.LastBuildOutput.ContainsText ("error XA5207:"), "XA5207 should have been raised."); Assert.IsTrue (builder.LastBuildOutput.ContainsText ($"Could not find android.jar for API level {proj.TargetSdkVersion}"), "XA5207 should have had a good error message."); + if (buildingInsideVisualStudio) + Assert.IsTrue (builder.LastBuildOutput.ContainsText ($"Either install it in the Android SDK Manager"), "XA5207 should have an error message for Visual Studio."); + else + Assert.IsTrue (builder.LastBuildOutput.ContainsText ($"You can install the missing API level by running"), "XA5207 should have an error message for the command line."); } Directory.Delete (AndroidSdkDirectory, recursive: true); } @@ -1030,6 +1035,8 @@ public void MicrosoftExtensionsHttp () [Test] public void FastDeploymentDoesNotAddContentProvider () { + AssertCommercialBuild (); + var proj = new XamarinAndroidApplicationProject { EmbedAssembliesIntoApk = false, }; @@ -1456,6 +1463,19 @@ public void XA4310 ([Values ("apk", "aab")] string packageFormat) } } + [Test] + public void XA1039 () + { + var proj = new XamarinAndroidApplicationProject { + PackageReferences = { + KnownPackages.SupportCompat_27_0_2_1 + } + }; + using var builder = CreateApkBuilder (); + Assert.IsTrue (builder.Build (proj), "build should have succeeded"); + StringAssertEx.Contains ("warning XA1039", builder.LastBuildOutput, "Should get XA1039 warning"); + } + [Test] [NonParallelizable] public void CheckLintErrorsAndWarnings () diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs index cbdaef62983..07496091a8a 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs @@ -1136,6 +1136,7 @@ public void BuildProguardEnabledProject (bool isRelease, string linkTool, string FileAssert.Exists (dexFile); var classes = new [] { "Lmono/MonoRuntimeProvider;", + "Lmono/android/view/View_OnClickListenerImplementor;", "Landroid/runtime/JavaProxyThrowable;", $"L{toolbar_class.Replace ('.', '/')};" }; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs index 6e1286fe27e..d1c8b1cefa4 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs @@ -605,11 +605,10 @@ public void DuplicateManagedNames () } [Test] - [Category ("Commercial")] public void LibraryProjectsShouldSkipGetPrimaryCpuAbi () { - if (!CommercialBuildAvailable) - Assert.Ignore ("Not required on Open Source Builds"); + AssertCommercialBuild (); + const string target = "_GetPrimaryCpuAbi"; var proj = new XamarinAndroidLibraryProject (); using (var b = CreateDllBuilder (Path.Combine ("temp", TestName))) { @@ -619,10 +618,10 @@ public void LibraryProjectsShouldSkipGetPrimaryCpuAbi () } [Test] - [Category ("Commercial")] public void LibraryReferenceWithHigherTFVShouldDisplayWarning ([Values (true, false)] bool isRelease) { - if (!CommercialBuildAvailable || Builder.UseDotNet) + + if (!TestEnvironment.CommercialBuildAvailable || Builder.UseDotNet) Assert.Ignore ("Not applicable to One .NET or single framework OSS builds."); var libproj = new XamarinAndroidLibraryProject () { @@ -670,6 +669,8 @@ public void AllResourcesInClassLibrary ([Values (true, false)] bool useAapt2, [V if (Builder.UseDotNet) { lib.RemoveProperty ("OutputType"); } + lib.AndroidManifest = lib.AndroidManifest. + Replace ("application android:label=\"${PROJECT_NAME}\"", "application android:label=\"com.test.foo\" "); // Create an "app" that is basically empty and references the library var app = new XamarinAndroidLibraryProject { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/CodeBehindTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/CodeBehindTests.cs index a64a11f7bce..6c87875bfa0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/CodeBehindTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/CodeBehindTests.cs @@ -124,7 +124,7 @@ public TestProjectInfo (string projectName, string testName, string rootDirector ProjectName = projectName; ObjPath = Path.Combine (rootDirectory, "obj"); - GeneratedPath = Path.Combine (ObjPath, XABuildPaths.Configuration, "generated"); + GeneratedPath = Path.Combine (ObjPath, XABuildPaths.Configuration, "codebehind"); BinPath = Path.Combine (rootDirectory, "bin", XABuildPaths.Configuration); ProjectPath = Path.Combine (rootDirectory, $"{projectName}.csproj"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs index 27177273816..1e581bc8cfa 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs @@ -10,15 +10,14 @@ namespace Xamarin.Android.Build.Tests { - [Category ("Node-2"), Category ("Commercial")] + [Category ("Node-2")] [TestFixture, NonParallelizable] public class DebuggingTasksTests : BaseTest { [OneTimeSetUp] public void SetUp () { - if (!CommercialBuildAvailable) - Assert.Ignore ("DebuggingTasksTests require Xamarin.Android.Build.Debugging.Tasks."); + AssertCommercialBuild (); } // https://github.com/xamarin/monodroid/blob/63bbeb076d809c74811a8001d38bf2e9e8672627/tests/msbuild/nunit/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests/ResolveXamarinAndroidToolsTests.cs diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs index 91649d560ef..9c8dfc894e2 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs @@ -694,6 +694,8 @@ public void LinkAssembliesNoShrink () [Test] public void CSProjUserFileChanges () { + AssertCommercialBuild (); + var proj = new XamarinAndroidApplicationProject (); var selectedDevice = "foo"; var csproj_user_file = $"{proj.ProjectName}.csproj.user"; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs index 5938f7102e3..e46af666639 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs @@ -73,6 +73,8 @@ public void EolFrameworks() [Test] public void XA0119 () { + AssertCommercialBuild (); + var proj = new XamarinAndroidApplicationProject (); proj.SetProperty ("_XASupportsFastDev", "True"); proj.SetProperty (proj.DebugProperties, "AndroidLinkMode", "Full"); @@ -86,6 +88,8 @@ public void XA0119 () [Test] public void XA0119AAB () { + AssertCommercialBuild (); + var proj = new XamarinAndroidApplicationProject (); proj.SetProperty ("_XASupportsFastDev", "True"); proj.SetProperty ("AndroidPackageFormat", "aab"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs index 1b97abb515d..ce6c48b0b90 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs @@ -568,6 +568,32 @@ public void ApplicationVersionTests (string applicationVersion, bool seperateApk } } + [Test] + public void ManifestDataPathError () + { + var proj = new XamarinAndroidApplicationProject () { + IsRelease = true, + }; + var s = proj.AndroidManifest.Replace ("", @" + + + + + + + + +"); + proj.AndroidManifest = s; + using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) { + builder.ThrowOnBuildFailure = false; + Assert.IsFalse (builder.Build (proj), "Build should have failed."); + var messages = builder.LastBuildOutput.SkipWhile (x => !x.StartsWith ("Build FAILED.", StringComparison.Ordinal)); + string error = messages.FirstOrDefault (x => x.Contains ("error APT2266:")); + Assert.IsNotNull (error, "Warning should be APT2266"); + } + } + [Test] public void ManifestPlaceholders ([Values ("legacy", "manifestmerger.jar")] string manifestMerger) { @@ -755,6 +781,7 @@ public void MergeLibraryManifest () KnownPackages.SupportV7AppCompat_27_0_2_1, }, }; + proj.SetProperty ("AndroidManifestMerger", "legacy"); proj.Sources.Add (new BuildItem.Source ("TestActivity1.cs") { TextContent = () => @"using System; using System.Collections.Generic; @@ -907,6 +934,33 @@ class TestActivity : Activity { }" } } + [Test] + [TestCase ("Android.Content.PM.ForegroundService.TypeSpecialUse", "specialUse")] + [TestCase ("Android.Content.PM.ForegroundService.TypeConnectedDevice", "connectedDevice")] + [TestCase ("Android.Content.PM.ForegroundService.TypeCamera|Android.Content.PM.ForegroundService.TypeMicrophone", "camera|microphone")] + public void AllForegroundServiceTypes (string serviceType, string expected) + { + var proj = new XamarinAndroidApplicationProject { + }; + + proj.Sources.Add (new BuildItem.Source ("TestActivity.cs") { + TextContent = () => $@"using Android.App; + using Android.Content.PM; + using Android.Views; + [Service (ForegroundServiceType = {serviceType})] + class TestService : Service {{ public override Android.OS.IBinder OnBind (Android.Content.Intent intent) {{ return null; }} }}" + }); + using (ProjectBuilder builder = CreateApkBuilder (Path.Combine ("temp", TestName))) { + Assert.IsTrue (builder.Build (proj), "Build should have succeeded"); + string manifest = builder.Output.GetIntermediaryAsText (Path.Combine ("android", "AndroidManifest.xml")); + var doc = XDocument.Parse (manifest); + var ns = XNamespace.Get ("http://schemas.android.com/apk/res/android"); + IEnumerable services = doc.Element ("manifest")?.Element ("application")?.Elements ("service"); + XElement e = services.FirstOrDefault (x => x.Attribute (ns.GetName ("foregroundServiceType"))?.Value == expected); + Assert.IsNotNull (e, $"Manifest should contain an service with a foregroundServiceType of {expected}"); + } + } + [Test] public void AllServiceAttributeProperties ([Values ("legacy", "manifestmerger.jar")] string manifestMerger) { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs index 5a9cabe50a5..407c32176a0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs @@ -516,6 +516,40 @@ public void AndroidUseNegotiateAuthentication ([Values (true, false, null)] bool } } + [Test] + public void PreserveIX509TrustManagerSubclasses ([Values(true, false)] bool hasServerCertificateCustomValidationCallback) + { + var proj = new XamarinAndroidApplicationProject { IsRelease = true }; + proj.AddReferences ("System.Net.Http"); + proj.MainActivity = proj.DefaultMainActivity.Replace ( + "base.OnCreate (bundle);", + "base.OnCreate (bundle);\n" + + (hasServerCertificateCustomValidationCallback + ? "var handler = new Xamarin.Android.Net.AndroidMessageHandler { ServerCertificateCustomValidationCallback = (message, certificate, chain, errors) => true };\n" + : "var handler = new Xamarin.Android.Net.AndroidMessageHandler();\n") + + "var client = new System.Net.Http.HttpClient (handler);\n" + + "client.GetAsync (\"https://microsoft.com\").GetAwaiter ().GetResult ();"); + + using (var b = CreateApkBuilder ()) { + Assert.IsTrue (b.Build (proj), "Build should have succeeded."); + var assemblyPath = BuildTest.GetLinkedPath (b, true, "Mono.Android.dll"); + + using (var assembly = AssemblyDefinition.ReadAssembly (assemblyPath)) { + Assert.IsTrue (assembly != null); + + var types = new[] { "Javax.Net.Ssl.X509ExtendedTrustManager", "Javax.Net.Ssl.IX509TrustManagerInvoker" }; + foreach (var typeName in types) { + var td = assembly.MainModule.GetType (typeName); + if (hasServerCertificateCustomValidationCallback) { + Assert.IsNotNull (td, $"{typeName} shouldn't have been linked out"); + } else { + Assert.IsNull (td, $"{typeName} should have been linked out"); + } + } + } + } + } + [Test] public void DoNotErrorOnPerArchJavaTypeDuplicates ([Values(true, false)] bool enableMarshalMethods) { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs index ec969f4dfd8..67485ff7f8d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/ManagedResourceParserTests.cs @@ -398,7 +398,8 @@ GenerateResourceDesigner CreateTask (string path) }; task.CaseMapFile = Path.Combine (Root, path, "case_map.txt"); task.IsApplication = true; - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", "android-27", "android.jar"); + int platform = AndroidSdkResolver.GetMaxInstalledPlatform (); + task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform}", "android.jar"); return task; } @@ -496,7 +497,8 @@ public void UpdateLayoutIdIsIncludedInDesigner ([Values(true, false)] bool useRt task.CaseMapFile = Path.Combine (Root, path, "case_map.txt"); File.WriteAllText (task.ResourceFlagFile, string.Empty); task.IsApplication = true; - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", "android-27", "android.jar"); + int platform = AndroidSdkResolver.GetMaxInstalledPlatform (); + task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform}", "android.jar"); Assert.IsTrue (task.Execute (), "Task should have executed successfully."); Assert.IsTrue (File.Exists (task.NetResgenOutputFile), $"{task.NetResgenOutputFile} should have been created."); var expected = Path.Combine (ExpectedOutputDir, "GenerateDesignerFileExpected.cs"); @@ -811,7 +813,8 @@ int styleable ElevenAttributes_attr09 9 task.ResourceDirectory = Path.Combine (Root, path, "res"); task.Resources = new TaskItem [] {}; task.IsApplication = true; - task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", "android-27", "android.jar"); + int platform = AndroidSdkResolver.GetMaxInstalledPlatform (); + task.JavaPlatformJarPath = Path.Combine (AndroidSdkDirectory, "platforms", $"android-{platform}", "android.jar"); Assert.IsTrue (task.Execute (), "Task should have executed successfully."); Assert.IsTrue (File.Exists (task.NetResgenOutputFile), $"{task.NetResgenOutputFile} should have been created."); var expected = Path.Combine (ExpectedOutputDir, "GenerateDesignerFileWithElevenStyleableAttributesExpected.cs"); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs index f6e2af09cc3..29c00189e8e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs @@ -27,16 +27,14 @@ public class BaseTest public string Root => Path.GetFullPath (XABuildPaths.TestOutputDirectory); - public static bool CommercialBuildAvailable => TestEnvironment.CommercialBuildAvailable; - /// /// Checks if a commercial Xamarin.Android is available /// * Defaults to Assert.Ignore () /// public void AssertCommercialBuild (bool fail = false) { - if (!CommercialBuildAvailable) { - var message = "This test requires a commercial build of Xamarin.Android."; + if (!TestEnvironment.CommercialBuildAvailable) { + var message = $"'{TestName}' requires a commercial build of Xamarin.Android."; if (fail) { Assert.Fail (message); } else { @@ -45,7 +43,7 @@ public void AssertCommercialBuild (bool fail = false) } } - char [] invalidChars = { '{', '}', '(', ')', '$', ':', ';', '\"', '\'', ',', '=' }; + char [] invalidChars = { '{', '}', '(', ')', '$', ':', ';', '\"', '\'', ',', '=', '|' }; public string TestName { get { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs index 825e77f6735..ed5becf6940 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs @@ -203,7 +203,7 @@ protected static void RunProjectAndAssert (XamarinAndroidApplicationProject proj if (Builder.UseDotNet) { builder.BuildLogFile = logName; Assert.True (builder.RunTarget (proj, "Run", doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters), "Project should have run."); - } else if (CommercialBuildAvailable) { + } else if (TestEnvironment.CommercialBuildAvailable) { builder.BuildLogFile = logName; Assert.True (builder.RunTarget (proj, "_Run", doNotCleanupOnUpdate: doNotCleanupOnUpdate, parameters: parameters), "Project should have run."); } else { diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs index 5caf109940b..304721be811 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownPackages.cs @@ -592,6 +592,10 @@ public static class KnownPackages Id = "SkiaSharp.Views", Version = "2.88.3", }; + public static Package Microsoft_Intune_Maui_Essentials_android = new Package { + Id = "Microsoft.Intune.Maui.Essentials.android", + Version = "10.0.0-beta2", + }; } } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs index 6118fc6a0c8..afa07f3ce27 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/ProjectBuilder.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using Microsoft.Build.Framework; using System.Xml.Linq; +using Xamarin.Android.Tools; namespace Xamarin.ProjectTools { @@ -154,21 +155,29 @@ public struct RuntimeInfo public RuntimeInfo [] GetSupportedRuntimes () { var runtimeInfo = new List (); - foreach (var file in Directory.EnumerateFiles (Path.Combine (TestEnvironment.AndroidMSBuildDirectory, "lib"), "libmono-android.*.so", SearchOption.AllDirectories)) { - string fullFilePath = Path.GetFullPath (file); - DirectoryInfo parentDir = Directory.GetParent (fullFilePath); - if (parentDir == null) - continue; - string[] items = Path.GetFileName (fullFilePath).Split ('.' ); - if (items.Length != 3) - continue; - var fi = new FileInfo (fullFilePath); - runtimeInfo.Add (new RuntimeInfo () { - Name = "libmonodroid.so", - Runtime = items [1], // release|debug - Abi = parentDir.Name, // armaebi|x86|arm64-v8a - Size = (int)fi.Length, // int - }); + var runtimeDirs = new HashSet (); + var rootRuntimeDirs = Directory.GetDirectories (TestEnvironment.DotNetPreviewPacksDirectory, $"Microsoft.Android.Runtime.{XABuildConfig.AndroidDefaultTargetDotnetApiLevel}.*"); + foreach (var dir in rootRuntimeDirs) { + runtimeDirs.Add (Directory.GetDirectories (dir).LastOrDefault ()); + } + + foreach (var runtimeDir in runtimeDirs) { + foreach (var file in Directory.EnumerateFiles (runtimeDir, "libmono-android.*.so", SearchOption.AllDirectories)) { + string fullFilePath = Path.GetFullPath (file); + DirectoryInfo parentDir = Directory.GetParent (fullFilePath); + if (parentDir == null) + continue; + string[] items = Path.GetFileName (fullFilePath).Split ('.' ); + if (items.Length != 3) + continue; + var fi = new FileInfo (fullFilePath); + runtimeInfo.Add (new RuntimeInfo () { + Name = "libmonodroid.so", + Runtime = items [1], // release|debug + Abi = parentDir.Name, // armaebi|x86|arm64-v8a + Size = (int)fi.Length, // int + }); + } } return runtimeInfo.ToArray (); } diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/XamarinProject.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/XamarinProject.cs index 7ce6c520bfe..a3fe0d7a4c0 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/XamarinProject.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/XamarinProject.cs @@ -95,6 +95,7 @@ public XamarinProject (string debugConfigurationName = "Debug", string releaseCo $@" {Configuration} + true " }); diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs b/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs index 959626874db..6b685a996c9 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs @@ -383,12 +383,26 @@ static string ToString (ForegroundService value) values.Add ("mediaProjection"); if (value.HasFlag (ForegroundService.TypePhoneCall)) values.Add ("phoneCall"); - - // These can be changed to enum members when API-R is the stable binding. - if (value.HasFlag ((ForegroundService)64)) + if (value.HasFlag (ForegroundService.TypeCamera)) values.Add ("camera"); - if (value.HasFlag ((ForegroundService)128)) + if (value.HasFlag (ForegroundService.TypeMicrophone)) values.Add ("microphone"); + if (value.HasFlag (ForegroundService.TypeHealth)) + values.Add ("health"); + if (value.HasFlag (ForegroundService.TypeRemoteMessaging)) + values.Add ("remoteMessaging"); + if (value.HasFlag (ForegroundService.TypeSystemExempted)) + values.Add ("systemExempted"); + if (value.HasFlag (ForegroundService.TypeShortService)) + values.Add ("shortService"); + if (value.HasFlag (ForegroundService.TypeSpecialUse)) + values.Add ("specialUse"); + + // When including a non-stable value you can cast the integer value + // to ForegroundService. We need to do this because the Build.Tasks + // only build against the latest STABLE api. + //if (value.HasFlag ((ForegroundService)128)) + // values.Add ("newValue"); return string.Join ("|", values.ToArray ()); } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs index d72b347d5e9..fda719dd7a1 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/MonoAndroidHelper.cs @@ -482,14 +482,14 @@ public static IEnumerable Executables (string executable) yield return executable; } - public static string TryGetAndroidJarPath (TaskLoggingHelper log, string platform, bool designTimeBuild = false) + public static string TryGetAndroidJarPath (TaskLoggingHelper log, string platform, bool designTimeBuild = false, bool buildingInsideVisualStudio = false, string targetFramework = "", string androidSdkDirectory = "") { var platformPath = MonoAndroidHelper.AndroidSdk.TryGetPlatformDirectoryFromApiLevel (platform, MonoAndroidHelper.SupportedVersions); if (platformPath == null) { if (!designTimeBuild) { var expectedPath = MonoAndroidHelper.AndroidSdk.GetPlatformDirectoryFromId (platform); - var sdkManagerMenuPath = OS.IsWindows ? Properties.Resources.XA5207_SDK_Manager_Windows : Properties.Resources.XA5207_SDK_Manager_macOS; - log.LogCodedError ("XA5207", Properties.Resources.XA5207, platform, Path.Combine (expectedPath, "android.jar"), sdkManagerMenuPath); + var sdkManagerMenuPath = buildingInsideVisualStudio ? Properties.Resources.XA5207_SDK_Manager_Windows : Properties.Resources.XA5207_SDK_Manager_CLI; + log.LogCodedError ("XA5207", Properties.Resources.XA5207, platform, Path.Combine (expectedPath, "android.jar"), string.Format (sdkManagerMenuPath, targetFramework, androidSdkDirectory)); } return null; } @@ -643,5 +643,37 @@ public static string GetNativeLibsRootDirectoryPath (string androidBinUtilsDirec string relPath = GetToolsRootDirectoryRelativePath (androidBinUtilsDirectory); return Path.GetFullPath (Path.Combine (androidBinUtilsDirectory, relPath, "lib")); } + + public static string? GetAssemblyCulture (ITaskItem assembly) + { + // The best option + string? culture = assembly.GetMetadata ("Culture"); + if (!String.IsNullOrEmpty (culture)) { + return TrimSlashes (culture); + } + + // ...slightly worse + culture = assembly.GetMetadata ("RelativePath"); + if (!String.IsNullOrEmpty (culture)) { + return TrimSlashes (Path.GetDirectoryName (culture)); + } + + // ...not ideal + culture = assembly.GetMetadata ("DestinationSubDirectory"); + if (!String.IsNullOrEmpty (culture)) { + return TrimSlashes (culture); + } + + return null; + + string? TrimSlashes (string? s) + { + if (String.IsNullOrEmpty (s)) { + return null; + } + + return s.TrimEnd ('/').TrimEnd ('\\'); + } + } } } diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/PathUtil.cs b/src/Xamarin.Android.Build.Tasks/Utilities/PathUtil.cs new file mode 100644 index 00000000000..5156ca8aa9a --- /dev/null +++ b/src/Xamarin.Android.Build.Tasks/Utilities/PathUtil.cs @@ -0,0 +1,289 @@ +using System; +using System.IO; +using System.Text; +using System.Runtime.InteropServices; + +namespace Xamarin.Android.Tools +{ + public static class PathUtil + { + + const int DevicePrefixLength = 4; + const int UncPrefixLength = 2; + const int UncExtendedPrefixLength = 8; + + internal const char VolumeSeparatorChar = ':'; + + static bool IsWindows = Path.DirectorySeparatorChar == '\\'; + // Adapted from CoreFX sources + public static string GetRelativePath(string relativeTo, string path, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) + { + if (String.IsNullOrEmpty(relativeTo)) + throw new ArgumentException("must not be null or empty", nameof(relativeTo)); + + if (String.IsNullOrEmpty(path)) + throw new ArgumentException("must not be null or empty", nameof(path)); + + relativeTo = Path.GetFullPath(relativeTo); + path = Path.GetFullPath(path); + + // Need to check if the roots are different- if they are we need to return the "to" path. + if (!AreRootsEqual(relativeTo, path, comparisonType)) + return path; + + int commonLength = GetCommonPathLength(relativeTo, path, ignoreCase: comparisonType == StringComparison.OrdinalIgnoreCase); + + // If there is nothing in common they can't share the same root, return the "to" path as is. + if (commonLength == 0) + return path; + + // Trailing separators aren't significant for comparison + int relativeToLength = relativeTo.Length; + if (EndsInDirectorySeparator(relativeTo)) + relativeToLength--; + + bool pathEndsInSeparator = EndsInDirectorySeparator(path); + int pathLength = path.Length; + if (pathEndsInSeparator) + pathLength--; + + // If we have effectively the same path, return "." + if (relativeToLength == pathLength && commonLength >= relativeToLength) + return "."; + + // We have the same root, we need to calculate the difference now using the + // common Length and Segment count past the length. + // + // Some examples: + // + // C:\Foo C:\Bar L3, S1 -> ..\Bar + // C:\Foo C:\Foo\Bar L6, S0 -> Bar + // C:\Foo\Bar C:\Bar\Bar L3, S2 -> ..\..\Bar\Bar + // C:\Foo\Foo C:\Foo\Bar L7, S1 -> ..\Bar + + var sb = new StringBuilder(Math.Max(relativeTo.Length, path.Length)); + + // Add parent segments for segments past the common on the "from" path + if (commonLength < relativeToLength) + { + sb.Append(".."); + + for (int i = commonLength + 1; i < relativeToLength; i++) + { + if (IsDirectorySeparator(relativeTo[i])) + { + sb.Append(Path.DirectorySeparatorChar); + sb.Append(".."); + } + } + } + else if (IsDirectorySeparator(path[commonLength])) + { + // No parent segments and we need to eat the initial separator + // (C:\Foo C:\Foo\Bar case) + commonLength++; + } + + // Now add the rest of the "to" path, adding back the trailing separator + int differenceLength = pathLength - commonLength; + if (pathEndsInSeparator) + differenceLength++; + + if (differenceLength > 0) + { + if (sb.Length > 0) + { + sb.Append(Path.DirectorySeparatorChar); + } + + sb.Append(path, commonLength, differenceLength); + } + + return sb.ToString(); + } + + // Adapted from CoreFX sources + static bool AreRootsEqual(string first, string second, StringComparison comparisonType) + { + int firstRootLength = GetRootLength(first); + int secondRootLength = GetRootLength(second); + + return firstRootLength == secondRootLength + && String.Compare( + strA: first, + indexA: 0, + strB: second, + indexB: 0, + length: firstRootLength, + comparisonType: comparisonType) == 0; + } + + // Adapted from CoreFX sources + static int GetCommonPathLength(string first, string second, bool ignoreCase) + { + int commonChars = EqualStartingCharacterCount(first, second, ignoreCase: ignoreCase); + + // If nothing matches + if (commonChars == 0) + return commonChars; + + // Or we're a full string and equal length or match to a separator + if (commonChars == first.Length && (commonChars == second.Length || IsDirectorySeparator(second[commonChars]))) + return commonChars; + + if (commonChars == second.Length && IsDirectorySeparator(first[commonChars])) + return commonChars; + + // It's possible we matched somewhere in the middle of a segment e.g. C:\Foodie and C:\Foobar. + while (commonChars > 0 && !IsDirectorySeparator(first[commonChars - 1])) + commonChars--; + + return commonChars; + } + + // Adapted from CoreFX sources + static unsafe int EqualStartingCharacterCount(string first, string second, bool ignoreCase) + { + if (String.IsNullOrEmpty(first) || string.IsNullOrEmpty(second)) + return 0; + + int commonChars = 0; + fixed (char* f = first) + { + fixed (char* s = second) + { + char* l = f; + char* r = s; + char* leftEnd = l + first.Length; + char* rightEnd = r + second.Length; + + while (l != leftEnd && r != rightEnd && (*l == *r || (ignoreCase && char.ToUpperInvariant((*l)) == char.ToUpperInvariant((*r))))) + { + commonChars++; + l++; + r++; + } + } + } + + return commonChars; + } + + // Adapted from CoreFX sources + static bool EndsInDirectorySeparator(string path) => path.Length > 0 && IsDirectorySeparator(path[path.Length - 1]); + + static bool IsDirectorySeparator(char c) + { + if (!IsWindows) + return c == Path.DirectorySeparatorChar; + return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; + } + + // Adapted from CoreFX sources + static int GetRootLength(string path) + { + if (!IsWindows) + return path.Length > 0 && IsDirectorySeparator(path[0]) ? 1 : 0; + return GetRootLength_ForWindows(path); + } + + internal static bool IsValidDriveChar(char value) + { + return ((value >= 'A' && value <= 'Z') || (value >= 'a' && value <= 'z')); + } + + // Adapted from CoreFX sources + static bool IsExtended(string path) + { + // While paths like "//?/C:/" will work, they're treated the same as "\\.\" paths. + // Skipping of normalization will *only* occur if back slashes ('\') are used. + return path.Length >= DevicePrefixLength + && path[0] == '\\' + && (path[1] == '\\' || path[1] == '?') + && path[2] == '?' + && path[3] == '\\'; + } + + // Adapted from CoreFX sources + static bool IsDevice(string path) + { + // If the path begins with any two separators is will be recognized and normalized and prepped with + // "\??\" for internal usage correctly. "\??\" is recognized and handled, "/??/" is not. + return IsExtended(path) || + ( + path.Length >= DevicePrefixLength + && IsDirectorySeparator(path[0]) + && IsDirectorySeparator(path[1]) + && (path[2] == '.' || path[2] == '?') + && IsDirectorySeparator(path[3]) + ); + } + + // Adapted from CoreFX sources + static bool IsDeviceUNC(string path) + { + return path.Length >= UncExtendedPrefixLength + && IsDevice(path) + && IsDirectorySeparator(path[7]) + && path[4] == 'U' + && path[5] == 'N' + && path[6] == 'C'; + } + + // Adapted from CoreFX sources + static int GetRootLength_ForWindows(string path) + { + int pathLength = path.Length; + int i = 0; + + bool deviceSyntax = IsDevice(path); + bool deviceUnc = deviceSyntax && IsDeviceUNC(path); + + if ((!deviceSyntax || deviceUnc) && pathLength > 0 && IsDirectorySeparator(path[0])) + { + // UNC or simple rooted path (e.g. "\foo", NOT "\\?\C:\foo") + if (deviceUnc || (pathLength > 1 && IsDirectorySeparator(path[1]))) + { + // UNC (\\?\UNC\ or \\), scan past server\share + + // Start past the prefix ("\\" or "\\?\UNC\") + i = deviceUnc ? UncExtendedPrefixLength : UncPrefixLength; + + // Skip two separators at most + int n = 2; + while (i < pathLength && (!IsDirectorySeparator(path[i]) || --n > 0)) + i++; + } + else + { + // Current drive rooted (e.g. "\foo") + i = 1; + } + } + else if (deviceSyntax) + { + // Device path (e.g. "\\?\.", "\\.\") + // Skip any characters following the prefix that aren't a separator + i = DevicePrefixLength; + while (i < pathLength && !IsDirectorySeparator(path[i])) + i++; + + // If there is another separator take it, as long as we have had at least one + // non-separator after the prefix (e.g. don't take "\\?\\", but take "\\?\a\") + if (i < pathLength && i > DevicePrefixLength && IsDirectorySeparator(path[i])) + i++; + } + else if (pathLength >= 2 && path[1] == VolumeSeparatorChar && IsValidDriveChar(path[0])) + { + // Valid drive specified path ("C:", "D:", etc.) + i = 2; + + // If the colon is followed by a directory separator, move past it (e.g "C:\") + if (pathLength > 2 && IsDirectorySeparator(path[2])) + i++; + } + + return i; + } + } +} \ No newline at end of file diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 71e64a76db7..76c9bf01ad0 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -275,7 +275,7 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. False SHA256withRSA SHA-256 - legacy + manifestmerger.jar 1G @@ -499,6 +499,23 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. /> + + + <_AndroidUnsupportedPackages + Include="%(ResolvedCompileFileDefinitions.NuGetPackageId)" + Condition=" '%(ResolvedCompileFileDefinitions.NuGetPackageId)' != '' and + ( $([System.String]::Copy(%(ResolvedCompileFileDefinitions.NuGetPackageId)).StartsWith ('Xamarin.Android.Arch.')) or + $([System.String]::Copy(%(ResolvedCompileFileDefinitions.NuGetPackageId)).StartsWith ('Xamarin.Android.Support.')) )" + /> + + + + + + <_AndroidExcludedDuplicateJavaLibraries Include="classes.jar" /> + <_AndroidExcludedDuplicateJavaLibraries Include="r-classes.jar" /> + <_AndroidExcludedDuplicateJavaLibraries Include="repackaged.jar" /> + + LibraryProjectJars="@(ExtractedJarImports)" + ExcludedFiles="@(_AndroidExcludedDuplicateJavaLibraries)" + /> @@ -917,7 +941,7 @@ because xbuild doesn't support framework reference assemblies. Resources $(IntermediateOutputPath) - $(IntermediateOutputPath)generated + $(IntermediateOutputPath)codebehind $(IntermediateOutputPath)resourcecache <_AndroidIntermediateJavaSourceDirectory>$(IntermediateOutputPath)android\src\ <_AndroidIntermediateDexOutputDirectory>$(IntermediateOutputPath)android\bin\ @@ -984,7 +1008,6 @@ because xbuild doesn't support framework reference assemblies. <_PropertyCacheItems Include="AndroidPackageNamingPolicy=$(AndroidPackageNamingPolicy)" /> <_PropertyCacheItems Include="_NuGetAssetsTimestamp=$(_NuGetAssetsTimestamp)" /> <_PropertyCacheItems Include="TypeMapKind=$(_TypeMapKind)" /> - <_PropertyCacheItems Include="AndroidSupportedAbis=$(AndroidSupportedAbis)" /> <_PropertyCacheItems Include="AndroidManifestPlaceholders=$(AndroidManifestPlaceholders)" /> <_PropertyCacheItems Include="ProjectFullPath=$(MSBuildProjectFullPath)" /> <_PropertyCacheItems Include="AndroidUseDesignerAssembly=$(AndroidUseDesignerAssembly)" /> @@ -1940,7 +1963,7 @@ because xbuild doesn't support framework reference assemblies. <_ProguardConfiguration Include="$(ProguardConfigFiles)" /> - <_ProguardConfiguration Include="$(_AndroidSdkDirectory)tools\proguard\proguard-android.txt" /> + <_ProguardConfiguration Include="$(_AndroidSdkDirectory)tools\proguard\proguard-android.txt" Condition=" Exists ('$(_AndroidSdkDirectory)tools\proguard\proguard-android.txt') " /> <_ProguardConfiguration Include="$(IntermediateOutputPath)proguard\proguard_xamarin.cfg" Condition=" '$(AndroidLinkTool)' != '' " /> <_ProguardConfiguration Include="$(_ProguardProjectConfiguration)" Condition=" '$(AndroidLinkTool)' != '' " /> <_ProguardConfiguration Include="$(IntermediateOutputPath)proguard\proguard_project_primary.cfg" Condition=" '$(AndroidLinkTool)' != '' " /> @@ -2550,6 +2573,8 @@ because xbuild doesn't support framework reference assemblies. + + diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets index ff86b19b484..a0c0abd4262 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Tooling.targets @@ -99,9 +99,12 @@ projects. diff --git a/src/profiled-aot/CommonMethods.cs b/src/profiled-aot/CommonMethods.cs index 7b298e2fc8d..e747ba4d93c 100644 --- a/src/profiled-aot/CommonMethods.cs +++ b/src/profiled-aot/CommonMethods.cs @@ -1,5 +1,6 @@ // This class represents common code paths we always want to AOT +// DateTime.Now // string interpolation & split // int.Parse(), int.ToString() // Culture-aware string comparisons @@ -15,8 +16,11 @@ static class CommonMethods // Returns '200 OK' if the caller wants to set that on the UI public static async Task Invoke() { - var url = $"https://httpstat.us/{200}"; + // NOTE: alternate web services if one of these is down + //var url = $"https://httpstat.us/{200}"; + var url = $"https://httpbin.org/status/{200}"; + var now = DateTime.Now; var foo = "foo"; foo.StartsWith("f"); foo.Contains("o"); diff --git a/src/profiled-aot/dotnet.aotprofile b/src/profiled-aot/dotnet.aotprofile index 15af4b92975..4aeb713f018 100644 Binary files a/src/profiled-aot/dotnet.aotprofile and b/src/profiled-aot/dotnet.aotprofile differ diff --git a/src/profiled-aot/dotnet.aotprofile.txt b/src/profiled-aot/dotnet.aotprofile.txt index 551b3439998..0104f27f01d 100644 --- a/src/profiled-aot/dotnet.aotprofile.txt +++ b/src/profiled-aot/dotnet.aotprofile.txt @@ -95,8 +95,8 @@ Methods: bool System.Collections.Generic.HashSet`1:Add (string) bool System.Collections.Generic.HashSet`1:AddIfNotPresent (string,int&) bool System.Collections.Generic.HashSet`1:Contains (string) - bool System.Collections.Generic.List`1/Enumerator:MoveNext () - bool System.Collections.Generic.List`1/Enumerator:MoveNextRare () + bool System.Collections.Generic.List`1/Enumerator:MoveNext () + bool System.Collections.Generic.List`1/Enumerator:MoveNextRare () bool System.Collections.Generic.List`1:Contains (string) bool System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalComparer:Equals (string,string) bool System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalIgnoreCaseComparer:Equals (string,string) @@ -178,17 +178,6 @@ Methods: bool System.MemoryExtensions:Overlaps (System.ReadOnlySpan`1,System.ReadOnlySpan`1) bool System.MemoryExtensions:StartsWith (System.ReadOnlySpan`1,System.ReadOnlySpan`1,System.StringComparison) bool System.MulticastDelegate:Equals (object) - bool System.Net.Cookie:DomainCharsTest (string) - bool System.Net.Cookie:get_Expired () - bool System.Net.Cookie:InternalSetName (string) - bool System.Net.Cookie:IsDomainEqualToHost (string,string) - bool System.Net.Cookie:VerifySetDefaults (System.Net.CookieVariant,System.Uri,bool,string,bool,bool) - bool System.Net.CookieComparer:EqualDomains (System.ReadOnlySpan`1,System.ReadOnlySpan`1) - bool System.Net.CookieComparer:Equals (System.Net.Cookie,System.Net.Cookie) - bool System.Net.CookieContainer:IsLocalDomain (string) - bool System.Net.CookieParser:EndofHeader () - bool System.Net.CookieParser:InternalSetNameMethod (System.Net.Cookie,string) - bool System.Net.CookieTokenizer/RecognizedAttribute:IsEqualTo (string) bool System.Net.Http.Headers.BaseHeaderParser:TryParseValue (string,object,int&,object&) bool System.Net.Http.Headers.HeaderDescriptor:Equals (System.Net.Http.Headers.HeaderDescriptor) bool System.Net.Http.Headers.HeaderDescriptor:TryGet (string,System.Net.Http.Headers.HeaderDescriptor&) @@ -208,7 +197,6 @@ Methods: bool System.Net.Http.HPack.IntegerEncoder:Encode (int,int,System.Span`1,int&) bool System.Net.Http.HttpClient:ShouldBufferResponse (System.Net.Http.HttpCompletionOption,System.Net.Http.HttpRequestMessage) bool System.Net.Http.HttpContent:CreateTemporaryBuffer (long,System.IO.MemoryStream&,System.Exception&) - bool System.Net.Http.HttpContent:TryDetectEncoding (System.ArraySegment`1,System.Text.Encoding&,int&) bool System.Net.Http.HttpContent:TryGetBuffer (System.ArraySegment`1&) bool System.Net.Http.HttpContent/LimitArrayPoolWriteStream:get_CanWrite () bool System.Net.Http.HttpMethod:Equals (System.Net.Http.HttpMethod) @@ -232,8 +220,6 @@ Methods: bool System.Reflection.AssemblyNameParser:IsWhiteSpace (char) bool System.Reflection.ConstructorInfo:op_Inequality (System.Reflection.ConstructorInfo,System.Reflection.ConstructorInfo) bool System.Reflection.CustomAttribute:IsUserCattrProvider (object) - bool System.Reflection.FieldInfo:get_IsLiteral () - bool System.Reflection.FieldInfo:get_IsStatic () bool System.Reflection.MethodBase:get_IsPublic () bool System.Reflection.MethodBase:get_IsStatic () bool System.Reflection.RuntimeMethodInfo:g__IsDisallowedByRefType|79_0 (System.Type) @@ -301,9 +287,7 @@ Methods: bool System.SpanHelpers:SequenceEqual (byte&,byte&,uintptr) bool System.String:Contains (char) bool System.String:Contains (string) - bool System.String:EndsWith (char) bool System.String:EndsWith (string,System.StringComparison) - bool System.String:Equals (object) bool System.String:Equals (string,string,System.StringComparison) bool System.String:Equals (string,string) bool System.String:Equals (string,System.StringComparison) @@ -449,9 +433,9 @@ Methods: int Java.Interop.JniPeerMembers/JniStaticFields:GetInt32Value (string) int Java.IO.InputStream:Read (byte[],int,int) int System.AppContextConfigHelper:GetInt32Config (string,int,bool) + int System.AppContextConfigHelper:GetInt32Config (string,string,int,bool) int System.Array:BinarySearch (string[],int,int,string,System.Collections.Generic.IComparer`1) int System.Array:BinarySearch (string[],string,System.Collections.Generic.IComparer`1) - int System.Array:BinarySearch (System.Array,int,int,object,System.Collections.IComparer) int System.Array:GetLowerBound (int) int System.Array:GetLowerBoundInternal (System.Runtime.CompilerServices.ObjectHandleOnStack,int) int System.ArraySegment`1:get_Count () @@ -463,8 +447,6 @@ Methods: int System.Buffers.Latin1CharSearchValues:IndexOfAnyExcept (System.ReadOnlySpan`1) int System.Buffers.Latin1CharSearchValues:LastIndexOfAny (char&,int) int System.Buffers.Latin1CharSearchValues:LastIndexOfAny (System.ReadOnlySpan`1) - int System.Collections.ArrayList:Add (object) - int System.Collections.ArrayList:get_Count () int System.Collections.Generic.ArraySortHelper`1:InternalBinarySearch (string[],int,int,string,System.Collections.Generic.IComparer`1) int System.Collections.Generic.Dictionary`2:Initialize (int) int System.Collections.Generic.Dictionary`2>:Initialize (int) @@ -478,19 +460,14 @@ Methods: int System.Collections.Generic.HashSet`1:FindItemIndex (string) int System.Collections.Generic.HashSet`1:Initialize (int) int System.Collections.Generic.List`1:EnsureCapacity (int) - int System.Collections.Generic.List`1:get_Count () + int System.Collections.Generic.List`1:get_Count () int System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalComparer:GetHashCode (string) int System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalIgnoreCaseComparer:GetHashCode (string) int System.Collections.Generic.ObjectEqualityComparer`1:GetHashCode (System.Type) int System.Collections.HashHelpers:ExpandPrime (int) int System.Collections.HashHelpers:GetPrime (int) int System.Collections.HashHelpers:GetPrime (int) - int System.Collections.Hashtable:get_Count () int System.Collections.Hashtable:GetHash (object) - int System.Collections.SortedList:get_Count () - int System.Collections.SortedList:IndexOfKey (object) - int System.Collections.SortedList/SyncSortedList:get_Count () - int System.Collections.SortedList/ValueList:get_Count () int System.DateTime:get_Year () int System.DateTimeFormat:ParseNextChar (System.ReadOnlySpan`1,int) int System.DateTimeFormat:ParseRepeatPattern (System.ReadOnlySpan`1,int,char) @@ -553,21 +530,11 @@ Methods: int System.MemoryExtensions:Split (System.ReadOnlySpan`1,System.Span`1,char,System.StringSplitOptions) int System.MemoryExtensions:SplitCore (System.ReadOnlySpan`1,System.Span`1,System.ReadOnlySpan`1,System.ReadOnlySpan`1,bool,System.StringSplitOptions) int System.MulticastDelegate:GetHashCode () - int System.Net.CookieCollection:get_Count () - int System.Net.CookieCollection:InternalAdd (System.Net.Cookie,bool) int System.Net.Http.Headers.HeaderUtilities:GetNextNonEmptyOrWhitespaceIndex (string,int,bool,bool&) - int System.Net.Http.Headers.HttpHeaders:g__Count|59_0 (object) - int System.Net.Http.Headers.HttpHeaders:GetValueCount (System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo) int System.Net.Http.Headers.Int64NumberHeaderParser:GetParsedValueLength (string,int,object,object&) - int System.Net.Http.Headers.MediaTypeHeaderParser:GetParsedValueLength (string,int,object,object&) - int System.Net.Http.Headers.MediaTypeHeaderValue:GetMediaTypeExpressionLength (string,int,string&) - int System.Net.Http.Headers.MediaTypeHeaderValue:GetMediaTypeLength (string,int,System.Func`1,System.Net.Http.Headers.MediaTypeHeaderValue&) int System.Net.Http.HttpRuleParser:GetNumberLength (string,int,bool) int System.Net.Http.HttpRuleParser:GetTokenLength (string,int) int System.Net.Http.HttpRuleParser:GetWhitespaceLength (string,int) - int System.Net.PathList:get_Count () - int System.Net.PathList:GetCookiesCount () - int System.Net.PathList/PathListComparer:System.Collections.IComparer.Compare (object,object) int System.Net.Primitives.Interop/Sys:GetDomainName (byte*,int) int System.Number:ParseBinaryInteger (System.ReadOnlySpan`1,System.Globalization.NumberStyles,System.Globalization.NumberFormatInfo) int System.Object:GetHashCode () @@ -628,7 +595,6 @@ Methods: int System.SpanHelpers:NonPackedIndexOfAnyValueType (int16&,int16,int16,int16,int) int System.SpanHelpers:NonPackedIndexOfValueType (int16&,int16,int) int System.SpanHelpers:SequenceCompareTo (byte&,int,byte&,int) - int System.String:Compare (string,int,string,int,int,System.StringComparison) int System.String:Compare (string,string,System.StringComparison) int System.String:CompareOrdinal (string,string) int System.String:CompareOrdinalHelper (string,string) @@ -658,6 +624,7 @@ Methods: int System.Text.UTF8Encoding/UTF8EncodingSealed:GetMaxByteCount (int) int System.Text.UTF8Encoding/UTF8EncodingSealed:GetMaxCharCount (int) int System.Threading.LowLevelLifoSemaphore:TimedWaitInternal (intptr,int) + int System.Threading.PortableThreadPool:DetermineThreadPoolThreadTimeoutMs () int System.Threading.PortableThreadPool/GateThread:GetRunningStateForNumRuns (int) int System.Threading.ProcessorIdCache:RefreshCurrentProcessorId () int System.Threading.ProcessorIdCache:UninlinedThreadStatic () @@ -686,9 +653,11 @@ Methods: int[] System.Globalization.CultureData:GetLocaleInfoCoreUserOverride (System.Globalization.CultureData/LocaleGroupingData) int[] System.Globalization.CultureData:IcuGetLocaleInfo (System.Globalization.CultureData/LocaleGroupingData) int16 System.AppContextConfigHelper:GetInt16Config (string,int16,bool) + int16 System.AppContextConfigHelper:GetInt16Config (string,string,int16,bool) int16 System.DateTimeOffset:ValidateOffset (System.TimeSpan) int16 System.Threading.PortableThreadPool:get_MinThreadsGoal () int16 System.Threading.PortableThreadPool:get_TargetThreadsGoalForBlockingAdjustment () + int16 System.Threading.PortableThreadPool/WorkerThread:DetermineThreadsToKeepAlive () int16 System.TimeZoneInfo:TZif_ToInt16 (System.ReadOnlySpan`1) Interop/Error System.Private.CoreLib.Interop/Sys:ConvertErrorPlatformToPal (int) Interop/ErrorInfo System.Private.CoreLib.Interop/Sys:GetLastErrorInfo () @@ -762,7 +731,6 @@ Methods: intptr System.Runtime.Loader.AssemblyLoadContext:InitializeAssemblyLoadContext (intptr,bool,bool) intptr System.Runtime.Loader.AssemblyLoadContext:InternalInitializeNativeALC (intptr,intptr,bool,bool) intptr System.RuntimeType:GetConstructors_native (System.Runtime.CompilerServices.QCallTypeHandle,System.Reflection.BindingFlags) - intptr System.RuntimeType:GetFields_native (System.Runtime.CompilerServices.QCallTypeHandle,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType) intptr System.RuntimeType:GetMethodsByName_native (System.Runtime.CompilerServices.QCallTypeHandle,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType) intptr System.Threading.LowLevelLifoSemaphore:InitInternal () intptr System.Threading.WaitSubsystem/HandleManager:NewHandle (System.Threading.WaitSubsystem/WaitableObject) @@ -853,10 +821,10 @@ Methods: Javax.Net.Ssl.SSLSocketFactory Xamarin.Android.Net.AndroidMessageHandler:ConfigureCustomSSLSocketFactory (Javax.Net.Ssl.HttpsURLConnection) Javax.Net.Ssl.TrustManagerFactory Xamarin.Android.Net.AndroidMessageHandler:ConfigureTrustManagerFactory (Java.Security.KeyStore) long System.BitConverter:DoubleToInt64Bits (double) + long System.DateTime:get_Ticks () long System.Diagnostics.Stopwatch:GetTimestamp () long System.Diagnostics.Stopwatch:QueryPerformanceCounter () long System.Environment:get_TickCount64 () - long System.IO.MemoryStream:get_Length () long System.IO.MemoryStream:Seek (long,System.IO.SeekOrigin) long System.IO.Strategies.BufferedFileStreamStrategy:get_Position () long System.IO.Strategies.BufferedFileStreamStrategy:Seek (long,System.IO.SeekOrigin) @@ -872,6 +840,7 @@ Methods: long System.Runtime.InteropServices.Marshal:ReadInt64 (intptr,int) long System.Threading.ThreadInt64PersistentCounter:get_Count () long System.Threading.TimerQueue:get_TickCount64 () + long System.TimeSpan:get_Ticks () long System.TimeZoneInfo:TZif_ToInt64 (byte[],int) long System.TimeZoneInfo:TZif_ToUnixTime (byte[],int,System.TimeZoneInfo/TZVersion) Microsoft.Win32.SafeHandles.SafeFileHandle Microsoft.Win32.SafeHandles.SafeFileHandle:Open (string,Interop/Sys/OpenFlags,int,bool,bool&,System.Func`4) @@ -892,23 +861,13 @@ Methods: object System.Activator:CreateInstance (System.Type) object System.AppContext:GetData (string) object System.Array:Clone () - object System.Collections.ArrayList:get_Item (int) object System.Collections.Hashtable:get_Item (object) - object System.Collections.Hashtable:get_SyncRoot () - object System.Collections.SortedList:get_Item (object) - object System.Collections.SortedList:get_SyncRoot () - object System.Collections.SortedList:GetByIndex (int) - object System.Collections.SortedList/SyncSortedList:get_Item (object) - object System.Collections.SortedList/SyncSortedList:get_SyncRoot () - object System.Collections.SortedList/ValueList:get_Item (int) object System.Delegate:get_Target () object System.GC:get_ephemeron_tombstone () object System.Globalization.CultureInfo:GetFormat (System.Type) object System.MulticastDelegate:GetTarget () object System.Net.Http.Headers.HttpHeaders:GetSingleParsedValue (System.Net.Http.Headers.HeaderDescriptor) object System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo:GetSingleParsedValue () - object System.Net.PathList:get_Item (string) - object System.Net.PathList:get_SyncRoot () object System.Object:MemberwiseClone () object System.Reflection.ConstructorInfo:Invoke (object[]) object System.Reflection.MethodBase:Invoke (object,object[]) @@ -968,6 +927,7 @@ Methods: string Java.Net.HttpURLConnection:get_ResponseMessage () string Java.Security.KeyStore:get_DefaultType () string System.AppContext:get_BaseDirectory () + string System.Collections.Generic.List`1:get_Item (int) string System.DomainNameHelper:ParseCanonicalName (string,int,int,bool&) string System.Environment:GetEnvironmentVariable (string) string System.Environment:GetEnvironmentVariableCore (string) @@ -1022,15 +982,9 @@ Methods: string System.IO.PathInternal:RemoveRelativeSegments (string,int) string System.IO.StreamReader:ReadLine () string System.Linq.Extensions/d__5`1:System.Collections.Generic.IEnumerator.get_Current () - string System.Net.Cookie:get_DomainKey () - string System.Net.Cookie:get_Name () string System.Net.CookieContainer:CreateFqdnMyDomain () string System.Net.CookieContainer:GetCookieHeader (System.Uri,string&) string System.Net.CookieContainer:GetCookieHeader (System.Uri) - string System.Net.CookieParser:CheckQuoted (string) - string System.Net.CookieTokenizer:Extract () - string System.Net.Http.Headers.MediaTypeHeaderValue:get_CharSet () - string System.Net.Http.HttpContent:ReadBufferAsString (System.ArraySegment`1,System.Net.Http.Headers.HttpContentHeaders) string System.Net.Http.HttpMethod:ToString () string System.Net.NetworkInformation.HostInformation:get_DomainName () string System.Net.NetworkInformation.HostInformationPal:GetDomainName () @@ -1078,7 +1032,6 @@ Methods: string System.String:ToLowerInvariant () string System.String:ToString () string System.String:Trim () - string System.StringExtensions:SubstringTrim (string,int,int) string System.Text.Encoding:GetString (System.ReadOnlySpan`1) string System.Text.UTF8Encoding:GetString (byte[],int,int) string System.Text.ValueStringBuilder:ToString () @@ -1128,14 +1081,12 @@ Methods: string[] System.Globalization.DateTimeFormatInfo:InternalGetAbbreviatedDayOfWeekNamesCore () string[] System.Globalization.DateTimeFormatInfo:InternalGetAbbreviatedMonthNames () string[] System.Globalization.DateTimeFormatInfo:InternalGetAbbreviatedMonthNamesCore () - string[] System.Net.Http.Headers.HttpHeaders:GetStoreValuesAsStringArray (System.Net.Http.Headers.HeaderDescriptor,System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo) string[] System.String:Split (char,System.StringSplitOptions) string[] System.String:SplitInternal (System.ReadOnlySpan`1,int,System.StringSplitOptions) string[] System.String:SplitWithoutPostProcessing (System.ReadOnlySpan`1,System.ReadOnlySpan`1,int,int) System.Action System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__0>:get_MoveNextAction () System.Array System.Array:CreateInstance (System.Type,int) System.Array System.Array:InternalCreate (System.RuntimeType,int,int*,int*) - System.ArraySegment`1 System.Net.Http.HttpContent/LimitArrayPoolWriteStream:GetBuffer () System.Attribute System.Attribute:GetAttr (System.Reflection.ICustomAttributeProvider,System.Type,bool) System.Attribute System.Attribute:GetCustomAttribute (System.Reflection.Assembly,System.Type) System.Attribute System.Reflection.CustomAttributeExtensions:GetCustomAttribute (System.Reflection.Assembly,System.Type) @@ -1171,11 +1122,8 @@ Methods: System.Collections.Generic.IList`1 Android.Runtime.JavaDictionary`2>:Get (string) System.Collections.Generic.IList`1 Android.Runtime.JavaDictionary`2>:get_Item (string) System.Collections.Generic.IList`1 Android.Runtime.JavaList`1:FromJniHandle (intptr,Android.Runtime.JniHandleOwnership) - System.Collections.Generic.List`1/Enumerator System.Collections.Generic.List`1:GetEnumerator () + System.Collections.Generic.List`1/Enumerator System.Collections.Generic.List`1:GetEnumerator () System.Collections.Generic.List`1 System.Threading.TimerQueue:InitializeScheduledTimerManager_Locked () - System.Collections.IList System.Collections.SortedList:GetValueList () - System.Collections.IList System.Collections.SortedList/SyncSortedList:GetValueList () - System.Collections.SortedList System.Collections.SortedList:Synchronized (System.Collections.SortedList) System.DateTime System.DateTime:AddMilliseconds (double) System.DateTime System.DateTime:AddTicks (long) System.DateTime System.DateTime:get_Date () @@ -1279,14 +1227,8 @@ Methods: System.IO.Stream Xamarin.Android.Net.AndroidMessageHandler:GetDecompressionWrapper (Java.Net.URLConnection,System.IO.Stream,Xamarin.Android.Net.AndroidMessageHandler/ContentState) System.IO.StreamReader System.IO.File:OpenText (string) System.LazyHelper System.LazyHelper:Create (System.Threading.LazyThreadSafetyMode,bool) - System.Net.Cookie System.Net.CookieCollection:get_Item (int) - System.Net.Cookie System.Net.CookieParser:Get () - System.Net.CookieCollection System.Net.CookieContainer:CookieCutter (System.Uri,string,string,bool) System.Net.CookieCollection System.Net.CookieContainer:InternalGetCookies (System.Uri) System.Net.CookieContainer Xamarin.Android.Net.AndroidMessageHandler:get_CookieContainer () - System.Net.CookieToken System.Net.CookieTokenizer:FindNext (bool,bool) - System.Net.CookieToken System.Net.CookieTokenizer:Next (bool,bool) - System.Net.CookieToken System.Net.CookieTokenizer:TokenFromName (bool) System.Net.Http.Headers.AltSvcHeaderParser System.Net.Http.Headers.AltSvcHeaderParser:get_Parser () System.Net.Http.Headers.AltSvcHeaderParser System.Net.Http.Headers.KnownHeaders:GetAltSvcHeaderParser () System.Net.Http.Headers.HttpContentHeaders System.Net.Http.HttpContent:get_Headers () @@ -1296,9 +1238,6 @@ Methods: System.Net.Http.Headers.HttpResponseHeaders System.Net.Http.HttpResponseMessage:get_Headers () System.Net.Http.Headers.KnownHeader System.Net.Http.Headers.KnownHeaders:GetCandidate (System.Net.Http.Headers.KnownHeaders/StringAccessor) System.Net.Http.Headers.KnownHeader System.Net.Http.Headers.KnownHeaders:TryGetKnownHeader (string) - System.Net.Http.Headers.MediaTypeHeaderValue System.Net.Http.Headers.HttpContentHeaders:get_ContentType () - System.Net.Http.Headers.MediaTypeHeaderValue System.Net.Http.Headers.MediaTypeHeaderParser:CreateMediaType () - System.Net.Http.Headers.NameValueHeaderValue System.Net.Http.Headers.NameValueHeaderValue:Find (System.Net.Http.Headers.UnvalidatedObjectCollection`1,string) System.Net.Http.HttpContent System.Net.Http.HttpResponseMessage:get_Content () System.Net.Http.HttpContent Xamarin.Android.Net.AndroidMessageHandler:GetContent (Java.Net.URLConnection,System.IO.Stream,Xamarin.Android.Net.AndroidMessageHandler/ContentState) System.Net.Http.HttpContent/LimitMemoryStream System.Net.Http.HttpContent:CreateMemoryStream (long,System.Exception&) @@ -1370,11 +1309,6 @@ Methods: System.Reflection.CorElementType System.RuntimeType:GetCorElementType () System.Reflection.CorElementType System.RuntimeTypeHandle:GetCorElementType (System.Runtime.CompilerServices.QCallTypeHandle) System.Reflection.CorElementType System.RuntimeTypeHandle:GetCorElementType (System.RuntimeType) - System.Reflection.FieldAttributes System.Reflection.RuntimeFieldInfo:get_Attributes () - System.Reflection.FieldInfo System.Net.CookieParser:get_IsQuotedDomainField () - System.Reflection.FieldInfo System.Reflection.FieldInfo:GetFieldFromHandle (System.RuntimeFieldHandle,System.RuntimeTypeHandle) - System.Reflection.FieldInfo System.Reflection.FieldInfo:internal_from_handle_type (intptr,intptr) - System.Reflection.FieldInfo System.RuntimeType:GetField (string,System.Reflection.BindingFlags) System.Reflection.ICustomAttributeProvider System.Reflection.CustomAttribute:GetBase (System.Reflection.ICustomAttributeProvider) System.Reflection.InvocationFlags System.Reflection.RuntimeConstructorInfo:ComputeAndUpdateInvocationFlags () System.Reflection.InvocationFlags System.Reflection.RuntimeMethodInfo:ComputeAndUpdateInvocationFlags () @@ -1407,7 +1341,6 @@ Methods: System.Reflection.RuntimeAssembly System.RuntimeTypeHandle:GetAssembly (System.RuntimeType) System.Reflection.RuntimeConstructorInfo System.RuntimeType:GetDefaultConstructor () System.Reflection.RuntimeConstructorInfo[] System.RuntimeType:GetConstructors_internal (System.Reflection.BindingFlags,System.RuntimeType) - System.Reflection.RuntimeFieldInfo[] System.RuntimeType:GetFields_internal (string,System.Reflection.BindingFlags,System.RuntimeType/MemberListType,System.RuntimeType) System.Reflection.RuntimeMethodInfo[] System.RuntimeType:GetMethodsByName (string,System.Reflection.BindingFlags,System.RuntimeType/MemberListType,System.RuntimeType) System.Reflection.RuntimeModule System.RuntimeType:GetRuntimeModule () System.Reflection.RuntimeModule System.RuntimeTypeHandle:GetModule (System.RuntimeType) @@ -1431,6 +1364,7 @@ Methods: System.Runtime.CompilerServices.IAsyncStateMachineBox System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:GetStateMachineBox (System.Net.Http.HttpClient/d__41&,System.Threading.Tasks.Task`1&) System.Runtime.CompilerServices.IAsyncStateMachineBox System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:GetStateMachineBox (System.IO.BufferedStream/d__68&,System.Threading.Tasks.Task`1&) System.Runtime.CompilerServices.IAsyncStateMachineBox System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:GetStateMachineBox (System.IO.Stream/<g__Core|27_0>d&,System.Threading.Tasks.Task`1&) + System.Runtime.CompilerServices.IAsyncStateMachineBox System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:GetStateMachineBox (System.Net.Http.HttpContent/d__63&,System.Threading.Tasks.Task`1&) System.Runtime.CompilerServices.IAsyncStateMachineBox System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:GetStateMachineBox (System.Net.Http.StreamToStreamCopy/<g__DisposeSourceAsync|1_0>d&,System.Threading.Tasks.Task`1&) System.Runtime.CompilerServices.TaskAwaiter System.Threading.Tasks.Task:GetAwaiter () System.Runtime.InteropServices.GCHandle System.Runtime.InteropServices.GCHandle:Alloc (object,System.Runtime.InteropServices.GCHandleType) @@ -1468,6 +1402,7 @@ Methods: System.Threading.ExecutionContext& System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__41>:get_Context () System.Threading.ExecutionContext& System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__68>:get_Context () System.Threading.ExecutionContext& System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__Core|27_0>d>:get_Context () + System.Threading.ExecutionContext& System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:get_Context () System.Threading.ExecutionContext& System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:get_Context () System.Threading.LowLevelLifoSemaphoreBase/Counts System.Threading.LowLevelLifoSemaphoreBase/Counts:InterlockedCompareExchange (System.Threading.LowLevelLifoSemaphoreBase/Counts,System.Threading.LowLevelLifoSemaphoreBase/Counts) System.Threading.PortableThreadPool/ThreadCounts System.Threading.PortableThreadPool/ThreadCounts:InterlockedCompareExchange (System.Threading.PortableThreadPool/ThreadCounts,System.Threading.PortableThreadPool/ThreadCounts) @@ -1533,9 +1468,6 @@ Methods: System.Threading.Tasks.TaskScheduler System.Threading.Tasks.TaskScheduler:get_Default () System.Threading.Tasks.TaskScheduler System.Threading.Tasks.TaskScheduler:get_InternalCurrent () System.Threading.Tasks.TaskStatus System.Threading.Tasks.Task:get_Status () - System.Threading.Tasks.ValueTask System.IO.MemoryStream:WriteAsync (System.ReadOnlyMemory`1,System.Threading.CancellationToken) - System.Threading.Tasks.ValueTask System.Net.Http.HttpContent/LimitArrayPoolWriteStream:WriteAsync (System.ReadOnlyMemory`1,System.Threading.CancellationToken) - System.Threading.Tasks.ValueTask System.Net.Http.HttpContent/LimitMemoryStream:WriteAsync (System.ReadOnlyMemory`1,System.Threading.CancellationToken) System.Threading.Tasks.ValueTask`1 System.IO.Stream:ReadAsync (System.Memory`1,System.Threading.CancellationToken) System.Threading.Tasks.ValueTask`1 System.Net.Http.Metrics.MetricsHandler:SendAsync (System.Net.Http.HttpRequestMessage,bool,System.Threading.CancellationToken) System.Threading.Thread System.Threading.Thread:get_CurrentThread () @@ -1545,7 +1477,6 @@ Methods: System.Threading.ThreadPoolWorkQueueThreadLocals System.Threading.ThreadPoolWorkQueue:GetOrCreateThreadLocals () System.Threading.ThreadState System.Threading.Thread:GetState (System.Threading.Thread) System.Threading.ThreadState System.Threading.Thread:ValidateThreadState () - System.Threading.TimerQueue System.Collections.Generic.List`1:get_Item (int) System.Threading.TimerQueue[] System.Threading.TimerQueue:CreateTimerQueues () System.Threading.TimerQueue[] System.Threading.TimerQueue:get_Instances () System.Threading.WaitSubsystem/ThreadWaitInfo System.Threading.Thread:g__AllocateWaitInfo|52_0 () @@ -1609,9 +1540,6 @@ Methods: System.Type System.Reflection.ParameterInfo:get_ParameterType () System.Type System.Reflection.RuntimeAssembly:GetType (string,bool,bool) System.Type System.Reflection.RuntimeConstructorInfo:get_DeclaringType () - System.Type System.Reflection.RuntimeFieldInfo:get_DeclaringType () - System.Type System.Reflection.RuntimeFieldInfo:get_FieldType () - System.Type System.Reflection.RuntimeFieldInfo:GetParentType (bool) System.Type System.Reflection.RuntimeMethodInfo:get_DeclaringType () System.Type System.Reflection.RuntimeMethodInfo:get_ReturnType () System.Type System.RuntimeType:get_BaseType () @@ -1875,7 +1803,6 @@ Methods: void System.ArgumentException:ThrowIfNullOrWhiteSpace (string,string) void System.ArgumentOutOfRangeException:ThrowIfGreaterThan (int,int,string) void System.ArgumentOutOfRangeException:ThrowIfGreaterThan (long,long,string) - void System.ArgumentOutOfRangeException:ThrowIfGreaterThanOrEqual (int,int,string) void System.ArgumentOutOfRangeException:ThrowIfLessThan (int,int,string) void System.ArgumentOutOfRangeException:ThrowIfLessThan (long,long,string) void System.ArgumentOutOfRangeException:ThrowIfNegative (int,string) @@ -1923,11 +1850,6 @@ Methods: void System.Buffers.SharedArrayPool`1:Return (byte[],bool) void System.Buffers.SharedArrayPool`1:.ctor () void System.Buffers.SharedArrayPool`1:Return (char[],bool) - void System.Collections.ArrayList:EnsureCapacity (int) - void System.Collections.ArrayList:set_Capacity (int) - void System.Collections.ArrayList:set_Item (int,object) - void System.Collections.Comparer:.cctor () - void System.Collections.Comparer:.ctor (System.Globalization.CultureInfo) void System.Collections.Concurrent.ConcurrentDictionary`2/Tables:.ctor (System.Collections.Concurrent.ConcurrentDictionary`2/VolatileNode[],object[],int[],System.Collections.Generic.IEqualityComparer`1) void System.Collections.Concurrent.ConcurrentDictionary`2:.ctor () void System.Collections.Concurrent.ConcurrentDictionary`2:.ctor (int,int,bool,System.Collections.Generic.IEqualityComparer`1) @@ -1977,7 +1899,7 @@ Methods: void System.Collections.Generic.HashSet`1:.ctor (System.Collections.Generic.IEqualityComparer`1) void System.Collections.Generic.HashSet`1:Resize () void System.Collections.Generic.HashSet`1:Resize (int,bool) - void System.Collections.Generic.List`1/Enumerator:.ctor (System.Collections.Generic.List`1) + void System.Collections.Generic.List`1/Enumerator:.ctor (System.Collections.Generic.List`1) void System.Collections.Generic.List`1:.cctor () void System.Collections.Generic.List`1:.ctor () void System.Collections.Generic.List`1:.cctor () @@ -1986,14 +1908,13 @@ Methods: void System.Collections.Generic.List`1:set_Capacity (int) void System.Collections.Generic.List`1:.ctor (int) void System.Collections.Generic.List`1:CopyTo (object[],int) - void System.Collections.Generic.List`1:.cctor () - void System.Collections.Generic.List`1:.ctor () - void System.Collections.Generic.List`1:Add (string) void System.Collections.Generic.List`1:set_Item (int,string) void System.Collections.Generic.List`1:RemoveAt (int) - void System.Collections.Generic.List`1:AddWithResize (Xamarin.Android.Net.IAndroidAuthenticationModule) - void System.Collections.Generic.List`1:Grow (int) - void System.Collections.Generic.List`1:set_Capacity (int) + void System.Collections.Generic.List`1:.cctor () + void System.Collections.Generic.List`1:.ctor () + void System.Collections.Generic.List`1:AddWithResize (System.TimeZoneInfo/AdjustmentRule) + void System.Collections.Generic.List`1:Grow (int) + void System.Collections.Generic.List`1:set_Capacity (int) void System.Collections.Generic.NonRandomizedStringEqualityComparer:.cctor () void System.Collections.Generic.NonRandomizedStringEqualityComparer:.ctor (System.Collections.Generic.IEqualityComparer`1) void System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalComparer:.ctor (System.Collections.Generic.IEqualityComparer`1) @@ -2005,15 +1926,6 @@ Methods: void System.Collections.Hashtable:.ctor (int) void System.Collections.Hashtable:Add (object,object) void System.Collections.Hashtable:Insert (object,object,bool) - void System.Collections.Hashtable:set_Item (object,object) - void System.Collections.SortedList:.ctor () - void System.Collections.SortedList:.ctor (System.Collections.IComparer) - void System.Collections.SortedList:EnsureCapacity (int) - void System.Collections.SortedList:Insert (int,object,object) - void System.Collections.SortedList:set_Capacity (int) - void System.Collections.SortedList:set_Item (object,object) - void System.Collections.SortedList/SyncSortedList:.ctor (System.Collections.SortedList) - void System.Collections.SortedList/SyncSortedList:set_Item (object,object) void System.DateTime:.cctor () void System.DateTime:.ctor (int,int,int,int,int,int) void System.DateTime:.ctor (int,int,int) @@ -2130,8 +2042,6 @@ Methods: void System.IO.FileStream:set_Position (long) void System.IO.FileStream:ValidateReadWriteArgs (byte[],int,int) void System.IO.MemoryStream:.ctor (int) - void System.IO.MemoryStream:EnsureWriteable () - void System.IO.MemoryStream:Write (byte[],int,int) void System.IO.Path:.cctor () void System.IO.Strategies.BufferedFileStreamStrategy:.ctor (System.IO.Strategies.FileStreamStrategy,int) void System.IO.Strategies.BufferedFileStreamStrategy:AllocateBuffer () @@ -2185,22 +2095,8 @@ Methods: void System.Linq.Extensions/d__5`1:<>m__Finally1 () void System.Linq.Extensions/d__5`1:System.IDisposable.Dispose () void System.Marvin:.cctor () - void System.Net.Cookie:.cctor () - void System.Net.Cookie:.ctor () - void System.Net.Cookie:set_Domain (string) - void System.Net.Cookie:set_HttpOnly (bool) - void System.Net.Cookie:set_Path (string) - void System.Net.Cookie:set_Secure (bool) - void System.Net.Cookie:set_Value (string) - void System.Net.CookieCollection:.ctor () void System.Net.CookieContainer:.cctor () void System.Net.CookieContainer:.ctor () - void System.Net.CookieContainer:Add (System.Net.Cookie,bool) - void System.Net.CookieContainer:SetCookies (System.Uri,string) - void System.Net.CookieParser:.ctor (string) - void System.Net.CookieTokenizer:.cctor () - void System.Net.CookieTokenizer:.ctor (string) - void System.Net.CookieTokenizer:Reset () void System.Net.Http.Headers.AltSvcHeaderParser:.cctor () void System.Net.Http.Headers.AltSvcHeaderParser:.ctor () void System.Net.Http.Headers.BaseHeaderParser:.ctor (bool) @@ -2222,12 +2118,9 @@ Methods: void System.Net.Http.Headers.HttpHeaderParser:.ctor (bool) void System.Net.Http.Headers.HttpHeaders:.ctor (System.Net.Http.Headers.HttpHeaderType,System.Net.Http.Headers.HttpHeaderType) void System.Net.Http.Headers.HttpHeaders:AddParsedValue (System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo,object) - void System.Net.Http.Headers.HttpHeaders:AddRawValue (System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo,string) - void System.Net.Http.Headers.HttpHeaders:AddValueToStoreValue (string,object&) - void System.Net.Http.Headers.HttpHeaders:GetStoreValuesAsStringOrStringArray (System.Net.Http.Headers.HeaderDescriptor,object,string&,string[]&) + void System.Net.Http.Headers.HttpHeaders:AddValueToStoreValue (object,object&) void System.Net.Http.Headers.HttpHeaders:ParseRawHeaderValues (System.Net.Http.Headers.HeaderDescriptor,System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo) void System.Net.Http.Headers.HttpHeaders:ParseSingleRawHeaderValue (System.Net.Http.Headers.HttpHeaders/HeaderStoreItemInfo,System.Net.Http.Headers.HeaderDescriptor,string) - void System.Net.Http.Headers.HttpHeaders:ReadStoreValues (System.Span`1,object,System.Net.Http.Headers.HttpHeaderParser,int&) void System.Net.Http.Headers.HttpRequestHeaders:.ctor () void System.Net.Http.Headers.HttpResponseHeaders:.ctor (bool) void System.Net.Http.Headers.Int32NumberHeaderParser:.cctor () @@ -2277,11 +2170,7 @@ Methods: void System.Net.Http.HttpContent/d__63:MoveNext () void System.Net.Http.HttpContent/LimitArrayPoolWriteStream:.ctor (int,long) void System.Net.Http.HttpContent/LimitArrayPoolWriteStream:Dispose (bool) - void System.Net.Http.HttpContent/LimitArrayPoolWriteStream:EnsureCapacity (int) - void System.Net.Http.HttpContent/LimitArrayPoolWriteStream:Write (System.ReadOnlySpan`1) void System.Net.Http.HttpContent/LimitMemoryStream:.ctor (int,int) - void System.Net.Http.HttpContent/LimitMemoryStream:CheckSize (int) - void System.Net.Http.HttpContent/LimitMemoryStream:Write (byte[],int,int) void System.Net.Http.HttpMessageHandler:Dispose () void System.Net.Http.HttpMessageInvoker:.ctor (System.Net.Http.HttpMessageHandler,bool) void System.Net.Http.HttpMessageInvoker:Dispose () @@ -2301,6 +2190,7 @@ Methods: void System.Net.Http.HttpTelemetry:.cctor () void System.Net.Http.HttpTelemetry:.ctor () void System.Net.Http.Metrics.MetricsHandler:.ctor (System.Net.Http.HttpMessageHandler,System.Diagnostics.Metrics.IMeterFactory,System.Diagnostics.Metrics.Meter&) + void System.Net.Http.Metrics.MetricsHandler:Dispose (bool) void System.Net.Http.Metrics.MetricsHandler/SharedMeter:.cctor () void System.Net.Http.Metrics.MetricsHandler/SharedMeter:.ctor () void System.Net.Http.StreamContent:.ctor (System.IO.Stream) @@ -2310,16 +2200,9 @@ Methods: void System.Net.Http.StreamToStreamCopy/<g__DisposeSourceAsync|1_0>d:MoveNext () void System.Net.HttpVersion:.cctor () void System.Net.NetEventSource:.cctor () - void System.Net.NetEventSource:.cctor () - void System.Net.NetEventSource:.ctor () void System.Net.NetEventSource:.ctor () - void System.Net.PathList:.ctor () - void System.Net.PathList:set_Item (string,object) - void System.Net.PathList/PathListComparer:.cctor () - void System.Net.PathList/PathListComparer:.ctor () void System.NullReferenceException:.ctor (string) void System.Number:.cctor () - void System.Numerics.Vector`1:.ctor (uint16) void System.OrdinalCaseSensitiveComparer:.cctor () void System.OrdinalCaseSensitiveComparer:.ctor () void System.OrdinalIgnoreCaseComparer:.cctor () @@ -2341,7 +2224,7 @@ Methods: void System.Private.CoreLib.ThreadWaitInfo/WaitedListNode:UnregisterWait (System.Threading.WaitSubsystem/WaitableObject) void System.Private.CoreLib.WorkerThread/<>c:.cctor () void System.Private.CoreLib.WorkerThread/<>c:.ctor () - void System.Private.CoreLib.WorkerThread/<>c:<.cctor>b__15_0 () + void System.Private.CoreLib.WorkerThread/<>c:<.cctor>b__17_0 () void System.Random/XoshiroImpl:.ctor () void System.Reflection.Assembly:.cctor () void System.Reflection.AssemblyName:.ctor (string) @@ -2353,7 +2236,6 @@ Methods: void System.Reflection.ConstructorInfo:.cctor () void System.Reflection.CustomAttribute:.cctor () void System.Reflection.Emit.OpCodes:.cctor () - void System.Reflection.FieldInfo:SetValue (object,object) void System.Reflection.MethodBaseInvoker:.ctor (System.Reflection.MethodBase,System.RuntimeType[]) void System.Reflection.MethodBaseInvoker:.ctor (System.Reflection.RuntimeConstructorInfo) void System.Reflection.MethodBaseInvoker:.ctor (System.Reflection.RuntimeMethodInfo) @@ -2364,9 +2246,6 @@ Methods: void System.Reflection.MonoMethodInfo:get_method_info (intptr,System.Reflection.MonoMethodInfo&) void System.Reflection.RuntimeAssembly:GetInfo (System.Runtime.CompilerServices.QCallAssembly,System.Runtime.CompilerServices.ObjectHandleOnStack,System.Reflection.RuntimeAssembly/AssemblyInfoKind) void System.Reflection.RuntimeAssembly/UnmanagedMemoryStreamForModule:.ctor (byte*,long,System.Reflection.Module) - void System.Reflection.RuntimeFieldInfo:CheckGeneric () - void System.Reflection.RuntimeFieldInfo:SetValue (object,object,System.Reflection.BindingFlags,System.Reflection.Binder,System.Globalization.CultureInfo) - void System.Reflection.RuntimeFieldInfo:SetValueInternal (System.Reflection.FieldInfo,object,object) void System.Reflection.RuntimeModule:GetGuidInternal (intptr,byte[]) void System.Reflection.RuntimeParameterInfo:.ctor (string,System.Type,int,int,object,System.Reflection.MemberInfo,System.Runtime.InteropServices.MarshalAsAttribute) void System.Resources.FastResourceComparer:.cctor () @@ -2431,10 +2310,15 @@ Methods: void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__Core|27_0>d>:ExecutionContextCallback (object) void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__Core|27_0>d>:MoveNext () void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__Core|27_0>d>:MoveNext (System.Threading.Thread) + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:.cctor () + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:.ctor () + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:ExecutionContextCallback (object) + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:MoveNext () + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1d__63>:MoveNext (System.Threading.Thread) void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:.cctor () void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:.ctor () - void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:ExecuteFromThreadPool (System.Threading.Thread) void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:ExecutionContextCallback (object) + void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:MoveNext () void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1/AsyncStateMachineBox`1g__DisposeSourceAsync|1_0>d>:MoveNext (System.Threading.Thread) void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:SetResult (Java.Net.Proxy) void System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:AwaitUnsafeOnCompleted (System.Runtime.CompilerServices.ConfiguredTaskAwaitable/ConfiguredTaskAwaiter&,System.Runtime.CompilerServices.IAsyncStateMachineBox) @@ -2493,7 +2377,6 @@ Methods: void System.RuntimeType:CacheFlag (System.RuntimeType/TypeCacheEntries,bool) void System.RuntimeType:CreateInstanceCheckThis () void System.RuntimeType:FilterHelper (System.Reflection.BindingFlags,string&,bool,bool&,bool&,System.RuntimeType/MemberListType&) - void System.RuntimeType:FilterHelper (System.Reflection.BindingFlags,string&,bool&,System.RuntimeType/MemberListType&) void System.RuntimeType:getFullName (System.Runtime.CompilerServices.QCallTypeHandle,System.Runtime.CompilerServices.ObjectHandleOnStack,bool,bool) void System.RuntimeType:GetGenericArgumentsInternal (System.Runtime.CompilerServices.QCallTypeHandle,System.Runtime.CompilerServices.ObjectHandleOnStack,bool) void System.RuntimeType:GetName (System.Runtime.CompilerServices.QCallTypeHandle,System.Runtime.CompilerServices.ObjectHandleOnStack) @@ -2512,7 +2395,6 @@ Methods: void System.RuntimeTypeHandle:internal_from_name (intptr,System.Threading.StackCrawlMark&,System.Runtime.CompilerServices.ObjectHandleOnStack,bool,bool) void System.SpanHelpers:ClearWithoutReferences (byte&,uintptr) void System.SpanHelpers:ClearWithReferences (intptr&,uintptr) - void System.SpanHelpers:Fill (char&,uintptr,char) void System.StackOverflowException:.ctor (string) void System.String:.ctor (char[],int,int) void System.String:.ctor (char*,int,int) diff --git a/src/r8/build.gradle b/src/r8/build.gradle index dfabca72b4c..41aa49470f0 100644 --- a/src/r8/build.gradle +++ b/src/r8/build.gradle @@ -15,7 +15,7 @@ repositories { } dependencies { - implementation 'com.android.tools:r8:8.1.56' + implementation 'com.android.tools:r8:8.2.33' } jar { diff --git a/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/Bug36250.cs b/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/Bug36250.cs deleted file mode 100644 index 1e435d02a94..00000000000 --- a/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/Bug36250.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace LinkTestLib -{ - // https://bugzilla.xamarin.com/show_bug.cgi?id=36250 - public class Bug36250 - { - // [Test] - public static string SerializeSearchRequestWithDictionary () - { - var req = new SearchRequest () { - Query = "query", - - Users = new List () { - "user_a", "user_b" - }, - - Filters = new List () { - "filter_a", "filter_b" - }, - - Parameters = new Dictionary () { - { "param_key_b", "param_value_a" }, - { "param_key_a", "param_value_b" }, - } - }; - - try { - using (MemoryStream memoryStream = new MemoryStream ()) { - var dataContractSerializer = new DataContractSerializer (typeof (SearchRequest)); - dataContractSerializer.WriteObject (memoryStream, req); - string serializedDataContract = Encoding.UTF8.GetString (memoryStream.ToArray (), 0, (int) memoryStream.Length); - return $"[PASS] SearchRequest successfully serialized: {serializedDataContract.Substring (0, 14)}"; - } - } catch (Exception ex) { - return $"[FAIL] SearchRequest serialization FAILED: {ex}"; - } - } - } - - [DataContract] - public class SearchRequest - { - [DataMember] - public string Query { get; set; } - [DataMember] - public List Users { get; set; } - [DataMember] - public List Filters { get; set; } - [DataMember] - public Dictionary Parameters { get; set; } - } -} diff --git a/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/MainActivityReplacement.cs b/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/MainActivityReplacement.cs index 44860c14466..2f26b0af776 100644 --- a/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/MainActivityReplacement.cs +++ b/tests/MSBuildDeviceIntegration/Resources/LinkDescTest/MainActivityReplacement.cs @@ -37,12 +37,8 @@ protected override void OnCreate(Bundle bundle) { var asm = typeof(Library1.SomeClass).Assembly; // TODO: ILLink removing .ctor: https://github.com/mono/linker/issues/1633 -#if NET Android.Util.Log.Info(TAG, $"[PASS] Able to use 'typeof({typeof(Library1.SomeClass)})'."); -#else - var o = Activator.CreateInstance(asm.GetType("Library1.SomeClass")); - Android.Util.Log.Info(TAG, $"[PASS] Able to create instance of '{o.GetType().Name}'."); -#endif + } catch (Exception ex) { @@ -126,9 +122,6 @@ protected override void OnCreate(Bundle bundle) Android.Util.Log.Info(TAG, LinkTestLib.Bug21578.MulticastOption_ShouldNotBeStripped()); Android.Util.Log.Info(TAG, LinkTestLib.Bug21578.MulticastOption_ShouldNotBeStripped2()); Android.Util.Log.Info(TAG, LinkTestLib.Bug35195.AttemptCreateTable()); -#if !NET - Android.Util.Log.Info(TAG, LinkTestLib.Bug36250.SerializeSearchRequestWithDictionary()); -#endif Android.Util.Log.Info(TAG, "All regression tests completed."); } } diff --git a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs index b94326b4684..5acf58203bd 100755 --- a/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs @@ -58,7 +58,7 @@ public void ApplicationRunsWithoutDebugger ([Values (false, true)] bool isReleas var proj = new XamarinFormsAndroidApplicationProject () { IsRelease = isRelease, }; - if (isRelease || !CommercialBuildAvailable) { + if (isRelease || !TestEnvironment.CommercialBuildAvailable) { proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); } proj.SetDefaultTargetDevice (); @@ -90,7 +90,7 @@ public void ClassLibraryMainLauncherRuns ([Values (true, false)] bool preloadAss var app = new XamarinAndroidApplicationProject { ProjectName = "MyApp", }; - if (!CommercialBuildAvailable) { + if (!TestEnvironment.CommercialBuildAvailable) { app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); } app.SetDefaultTargetDevice (); diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index a6e903cc6dd..ea9f5da4c7c 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -73,7 +73,7 @@ public void NativeAssemblyCacheWithSatelliteAssemblies ([Values (true, false)] b Assert.IsTrue (helper.Exists ($"assemblies/{lang}/{lib.ProjectName}.resources.dll"), $"Apk should contain satellite assembly for language '{lang}'!"); } - Assert.True (builder.RunTarget (proj, "_Run"), "Project should have run."); + RunProjectAndAssert (proj, builder); Assert.True (WaitForActivityToStart (proj.PackageName, "MainActivity", Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30), "Activity should have started."); } @@ -88,7 +88,7 @@ public void GlobalLayoutEvent_ShouldRegisterAndFire_OnActivityLaunch ([Values (f IsRelease = isRelease, SupportedOSPlatformVersion = "23", }; - if (isRelease || !CommercialBuildAvailable) { + if (isRelease || !TestEnvironment.CommercialBuildAvailable) { proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64"); } proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", @@ -124,11 +124,7 @@ public void SubscribeToAppDomainUnhandledException () Assert.IsTrue (builder.Install (proj), "Install should have succeeded."); RunProjectAndAssert (proj, builder); -#if NETCOREAPP string expectedLogcatOutput = "# Unhandled Exception: sender=System.Object; e.IsTerminating=True; e.ExceptionObject=System.Exception: CRASH"; -#else // NETCOREAPP - string expectedLogcatOutput = "# Unhandled Exception: sender=RootDomain; e.IsTerminating=True; e.ExceptionObject=System.Exception: CRASH"; -#endif // NETCOREAPP Assert.IsTrue ( MonitorAdbLogcat (CreateLineChecker (expectedLogcatOutput), logcatFilePath: Path.Combine (Root, builder.ProjectDirectory, "startup-logcat.log"), timeout: 60), @@ -253,14 +249,6 @@ public class LinkModeFullClass { }, }; - if (!Builder.UseDotNet) { - // DataContractSerializer is not trimming safe - // https://github.com/dotnet/runtime/issues/45559 - lib2.Sources.Add (new BuildItem.Source ("Bug36250.cs") { - TextContent = () => getResource ("Bug36250") - }); - } - proj = new XamarinFormsAndroidApplicationProject () { IsRelease = true, AndroidLinkModeRelease = linkMode, @@ -356,7 +344,7 @@ public void JsonDeserializationCreatesJavaHandle ([Values (false, true)] bool is // error SYSLIB0011: 'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.' proj.SetProperty ("NoWarn", "SYSLIB0011"); - if (isRelease || !CommercialBuildAvailable) { + if (isRelease || !TestEnvironment.CommercialBuildAvailable) { proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64"); } @@ -396,41 +384,13 @@ void TestJsonDeserialization (Person p) Console.WriteLine ($""JSON Person deserialized OK""); } - void TestBinaryDeserialization (Person p) - { - var stream = new MemoryStream (); - var serializer = new BinaryFormatter(); - - serializer.Serialize (stream, p); - - stream.Position = 0; - StreamReader sr = new StreamReader (stream); - - stream.Position = 0; - serializer.Binder = new Person.Binder (); - Person p2 = (Person) serializer.Deserialize (stream); - - Console.WriteLine ($""BinaryFormatter deserialzied: Name '{p2.Name}' Age '{p2.Age}' Handle '0x{p2.Handle:X}'""); - - if (p2.Name != ""John Smith"") - throw new InvalidOperationException (""BinaryFormatter deserialization of Name""); - if (p2.Age != 900) - throw new InvalidOperationException (""BinaryFormatter deserialization of Age""); - if (p2.Handle == IntPtr.Zero) - throw new InvalidOperationException (""Failed to instantiate new Java instance for Person!""); - - Console.WriteLine ($""BinaryFormatter Person deserialized OK""); - } - void TestJsonDeserializationCreatesJavaHandle () { Person p = new Person () { Name = ""John Smith"", Age = 900, }; -#if !NET - TestBinaryDeserialization (p); -#endif + TestJsonDeserialization (p);").Replace ("//${AFTER_MAINACTIVITY}", @" [DataContract] [Serializable] @@ -616,6 +576,8 @@ public void ResourceDesignerWithNuGetReference ([Values ("net8.0-android")] stri [Test] public void SingleProject_ApplicationId ([Values (false, true)] bool testOnly) { + AssertCommercialBuild (); + proj = new XamarinAndroidApplicationProject (); proj.SetProperty ("ApplicationId", "com.i.should.get.overridden.by.the.manifest"); if (testOnly) @@ -1115,5 +1077,92 @@ public void EnableAndroidStripILAfterAOT ([Values (false, true)] bool profiledAO Assert.IsTrue(didLaunch, "Activity should have started."); } + [Test] + public void FixLegacyResourceDesignerStep ([Values (true, false)] bool isRelease) + { + string previousTargetFramework = "net7.0-android"; + + var library1 = new XamarinAndroidLibraryProject { + IsRelease = isRelease, + TargetFramework = previousTargetFramework, + ProjectName = "Library1", + AndroidResources = { + new AndroidItem.AndroidResource (() => "Resources\\values\\strings2.xml") { + TextContent = () => @" + + Hi! +", + }, + }, + }; + var library2 = new XamarinAndroidLibraryProject { + IsRelease = isRelease, + TargetFramework = previousTargetFramework, + ProjectName = "Library2", + OtherBuildItems = { + new BuildItem.Source("Foo.cs") { + TextContent = () => "public class Foo { public static int Hello => Library1.Resource.String.hello; } ", + } + } + }; + library2.AndroidResources.Clear (); + library2.SetProperty ("AndroidGenerateResourceDesigner", "false"); // Disable Android Resource Designer generation + library2.AddReference (library1); + proj = new XamarinAndroidApplicationProject { + IsRelease = isRelease, + ProjectName = "MyApp", + }; + proj.AddReference (library2); + proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}", "Console.WriteLine(Foo.Hello);"); + + using (var library1Builder = CreateDllBuilder (Path.Combine ("temp", TestName, library1.ProjectName))) + using (var library2Builder = CreateDllBuilder (Path.Combine ("temp", TestName, library2.ProjectName))) { + builder = CreateApkBuilder (Path.Combine ("temp", TestName, proj.ProjectName)); + Assert.IsTrue (library1Builder.Build (library1, doNotCleanupOnUpdate: true), $"Build of {library1.ProjectName} should have succeeded."); + Assert.IsTrue (library2Builder.Build (library2, doNotCleanupOnUpdate: true), $"Build of {library2.ProjectName} should have succeeded."); + Assert.IsTrue (builder.Build (proj), $"Build of {proj.ProjectName} should have succeeded."); + + RunProjectAndAssert (proj, builder); + + WaitForPermissionActivity (Path.Combine (Root, builder.ProjectDirectory, "permission-logcat.log")); + bool didLaunch = WaitForActivityToStart (proj.PackageName, "MainActivity", + Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30); + Assert.IsTrue (didLaunch, "Activity should have started."); + } + } + + [Test] + public void MicrosoftIntune ([Values (false, true)] bool isRelease) + { + proj = new XamarinAndroidApplicationProject { + IsRelease = isRelease, + PackageReferences = { + KnownPackages.AndroidXAppCompat, + KnownPackages.Microsoft_Intune_Maui_Essentials_android, + }, + }; + proj.MainActivity = proj.DefaultMainActivity + .Replace ("Icon = \"@drawable/icon\")]", "Icon = \"@drawable/icon\", Theme = \"@style/Theme.AppCompat.Light.DarkActionBar\")]") + .Replace ("public class MainActivity : Activity", "public class MainActivity : AndroidX.AppCompat.App.AppCompatActivity"); + var abis = new string [] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" }; + proj.SetAndroidSupportedAbis (abis); + builder = CreateApkBuilder (); + builder.BuildLogFile = "install.log"; + Assert.IsTrue (builder.Install (proj), "Install should have succeeded."); + + var intermediate = Path.Combine (Root, builder.ProjectDirectory, proj.IntermediateOutputPath); + var dexFile = Path.Combine (intermediate, "android", "bin", "classes.dex"); + FileAssert.Exists (dexFile); + var className = "Lcom/xamarin/microsoftintune/MainActivity;"; + var methodName = "onMAMCreate"; + Assert.IsTrue (DexUtils.ContainsClassWithMethod (className, methodName, "(Landroid/os/Bundle;)V", dexFile, AndroidSdkPath), $"`{dexFile}` should include `{className}` and `{methodName}!"); + + RunProjectAndAssert (proj, builder); + + WaitForPermissionActivity (Path.Combine (Root, builder.ProjectDirectory, "permission-logcat.log")); + bool didLaunch = WaitForActivityToStart (proj.PackageName, "MainActivity", + Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30); + Assert.IsTrue (didLaunch, "Activity should have started."); + } } } diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs index 75ffe121ca4..d77fec4f228 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs @@ -12,7 +12,7 @@ namespace Xamarin.Android.Build.Tests { [TestFixture] - [Category ("Commercial"), Category ("UsesDevice")] + [Category ("UsesDevice")] public class InstallTests : DeviceTest { string GetContentFromAllOverrideDirectories (string packageName, bool useRunAsCommand = true) diff --git a/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs b/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs index 6cbc552c57b..5c4b9429b08 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstantRunTest.cs @@ -7,7 +7,7 @@ namespace Xamarin.Android.Build.Tests { [TestFixture] - [Category ("Commercial"), Category ("UsesDevice")] + [Category ("UsesDevice")] public class InstantRunTest : DeviceTest { [Test] diff --git a/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs b/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs index 6d41a39204f..ccd23bc34d2 100644 --- a/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs @@ -11,7 +11,7 @@ namespace Xamarin.Android.Build.Tests { [TestFixture] - [Category ("Commercial"), Category ("UsesDevice")] + [Category ("UsesDevice")] public class SystemApplicationTests : DeviceTest { // All Tests here require the emulator to be started with -writable-system diff --git a/tests/Mono.Android-Tests/Android.Runtime/AndroidEnvironmentTest.cs b/tests/Mono.Android-Tests/Android.Runtime/AndroidEnvironmentTest.cs index 47600ffdab6..76ff2e50b69 100644 --- a/tests/Mono.Android-Tests/Android.Runtime/AndroidEnvironmentTest.cs +++ b/tests/Mono.Android-Tests/Android.Runtime/AndroidEnvironmentTest.cs @@ -28,12 +28,10 @@ public void TearDown () [Test] [TestCase (null)] [TestCase ("Xamarin.Android.Net.AndroidHttpResponseMessage")] // does not extend HttpMessageHandler -#if NET // instantiating AndroidClientHandler or HttpClientHandler (or any other type extending HttpClientHandler) // would cause infinite recursion in the .NET build and so it is replaced with AndroidMessageHandler [TestCase ("System.Net.Http.HttpClientHandler, System.Net.Http")] [TestCase ("Xamarin.Android.Net.AndroidClientHandler")] -#endif public void GetHttpMessageHandler_FallbackToAndroidMessageHandler (string? typeName) { var handler = GetHttpMessageHandler (typeName); @@ -56,10 +54,6 @@ public void GetHttpMessageHandler_FallbackForInaccessibleTypes (string typeName) [Test] [TestCase ("Xamarin.Android.Net.AndroidMessageHandler")] [TestCase ("System.Net.Http.SocketsHttpHandler, System.Net.Http")] -#if !NET - [TestCase ("Xamarin.Android.Net.AndroidClientHandler")] - [TestCase ("System.Net.Http.HttpClientHandler, System.Net.Http")] -#endif public void GetHttpMessageHandler_OverridesDefaultValue (string typeName) { var handler = GetHttpMessageHandler (typeName); diff --git a/tests/Mono.Android-Tests/System.Net/SslTest.cs b/tests/Mono.Android-Tests/System.Net/SslTest.cs index 934435d52fb..ba104387632 100644 --- a/tests/Mono.Android-Tests/System.Net/SslTest.cs +++ b/tests/Mono.Android-Tests/System.Net/SslTest.cs @@ -71,11 +71,9 @@ public void SslWithinTasksShouldWork () [Test] public void HttpsShouldWork () { -#if NET6_0_OR_GREATER if (!OperatingSystem.IsAndroidVersionAtLeast (24)) { Assert.Ignore ("Not supported on API 23 and lower."); } -#endif // NET6_0_OR_GREATER RunIgnoringWebException (DoHttpsShouldWork); } @@ -117,11 +115,9 @@ void DoHttpsShouldWork () [Test (Description="Bug https://bugzilla.xamarin.com/show_bug.cgi?id=18962")] public void VerifyTrustedCertificates () { -#if NET6_0_OR_GREATER if (!OperatingSystem.IsAndroidVersionAtLeast (24)) { Assert.Ignore ("Not supported on API 23 and lower."); } -#endif // NET6_0_OR_GREATER Assert.DoesNotThrow (() => RunIgnoringWebException (DoVerifyTrustedCertificates), "Certificate validation"); } diff --git a/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs b/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs index c462fc4ed20..b71ee2893da 100644 --- a/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs +++ b/tests/Mono.Android-Tests/Xamarin.Android.Net/AndroidMessageHandlerTests.cs @@ -36,7 +36,6 @@ protected override HttpMessageHandler CreateHandler () }, }; -#if NET [Test] [TestCaseSource (nameof (DecompressionSource))] // Disabled because it doesn't exist in NUnitLite, uncomment when/if we switch to full NUnit @@ -98,7 +97,31 @@ async Task DoDecompression (string urlPath, string encoding, string jsonFi return true; } -#endif + + [Test] + public async Task DoesNotDisposeContentStream() + { + using var listener = new HttpListener (); + listener.Prefixes.Add ("http://+:47663/"); + listener.Start (); + listener.BeginGetContext (ar => { + var ctx = listener.EndGetContext (ar); + ctx.Response.StatusCode = 204; + ctx.Response.ContentLength64 = 0; + ctx.Response.Close (); + }, null); + + var jsonContent = new StringContent ("hello"); + var request = new HttpRequestMessage (HttpMethod.Post, "http://localhost:47663/") { Content = jsonContent }; + + var response = await new HttpClient (new AndroidMessageHandler ()).SendAsync (request); + Assert.True (response.IsSuccessStatusCode); + + var contentValue = await jsonContent.ReadAsStringAsync (); + Assert.AreEqual ("hello", contentValue); + + listener.Close (); + } [Test] public async Task ServerCertificateCustomValidationCallback_ApproveRequest () @@ -219,14 +242,10 @@ private async Task AssertRejectsRemoteCertificate (Func makeRequest) await makeRequest(); Assert.Fail ("The request wasn't rejected"); } -#if NET // While technically we should be throwing only HttpRequestException (as per HttpClient.SendAsync docs), in reality // we need to consider legacy code that migrated to .NET and may still expect WebException. Thus, we throw both // of these and we need to catch both here catch (System.Net.WebException) {} -#else - catch (Java.IO.IOException) {} -#endif catch (System.Net.Http.HttpRequestException) {} } }