From ead873af4e8cee2d34167c06c6169761d57261f9 Mon Sep 17 00:00:00 2001 From: Brendan Zagaeski Date: Tue, 28 Jul 2020 15:21:20 -0700 Subject: [PATCH] [Xamarin.Android.Build.Tasks] Add XA1025 error for Hybrid AOT on armeabi-v7a Context: https://github.com/xamarin/xamarin-android/issues/1218#issuecomment-661337842 The undocumented, experimental `Hybrid` value for the `$(AndroidAotMode)` MSBuild property is not currently compatible with the armeabi-v7a target ABI. Attempting to run an app built with `$(AndroidAotMode)`=`Hybrid` in an armeabi-v7a environment results in a crash. Since it is known that this configuration currently produces a crash, emit a build error for it to improve the visibility of the known issue and reduce the time users might spend searching for the cause of the crash. Example of the current crash: F libc : Fatal signal 11 (SIGSEGV), code 2, fault addr 0x913a50c8 in tid 31140 (ppxamarinforms1) W : debuggerd: handling request: pid=31140 uid=10146 gid=10146 tid=31140 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** F DEBUG : Build fingerprint: 'motorola/perry_metropcs_c/perry:7.1.1/NCQS26.69-64-21/33:user/release-keys' F DEBUG : Revision: 'p3b0' F DEBUG : ABI: 'arm' F DEBUG : pid: 31140, tid: 31140, name: ppxamarinforms1 >>> com.companyname.mobileappxamarinforms1 <<< F DEBUG : signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x913a50c8 F DEBUG : r0 be9384d4 r1 00000000 r2 be9385a0 r3 9320b1c0 F DEBUG : r4 00000000 r5 94167208 r6 00000000 r7 be938584 F DEBUG : r8 be938838 r9 ae040008 sl 00000000 fp be9385a0 F DEBUG : ip 913a50c8 sp be9384e4 lr 942a8420 pc 913a50c8 cpsr 000f0010 F DEBUG : F DEBUG : backtrace: F DEBUG : #00 pc 000250c8 [anon:libc_malloc:91380000] F DEBUG : #01 pc 0000141c W ActivityManager: Activity pause timeout for ActivityRecord{7ded4d1 u0 com.companyname.mobileappxamarinforms1/crc64e53dff5578afb8f2.MainActivity t5740} I ActivityManager: Killing 30471:com.google.android.apps.fireball/u0a145 (adj 906): empty #13 D ConnectivityService: ConnectivityService NetworkRequestInfo binderDied(NetworkRequest [ LISTEN id=624, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ], android.os.BinderProxy@f4c4e10) D ActivityManager: cleanUpApplicationRecord -- 30471 E ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ LISTEN id=624, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&FOREGROUND] ] W : debuggerd: resuming target 31140 I BootReceiver: Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE) W ActivityManager: Force finishing activity com.companyname.mobileappxamarinforms1/crc64e53dff5578afb8f2.MainActivity I Zygote : Process 31140 exited due to signal (11) Other changes: Update the `HybridAOT` test to cover the new error. Correct the `BuildIncrementalAot` test so that it sets `$(AndroidSupportedAbis)`. A side-effect is that the test cases that use `$(AndroidAotMode)`=`Full` now build successfully. Note that although those test cases now build successfully, the resulting app packages abort when run on device because Xamarin.Android requires JIT compilation: Unhandled Exception: System.ExecutionEngineException: Attempting to JIT compile method '(wrapper other) void Java.Interop.JavaVMInterface:PtrToStructure (intptr,object)' while running in aot-only mode. TODO: Add a build error for `$(AndroidAotMode)`=`Full`, likely by updating error XA3002. --- Documentation/guides/messages/README.md | 1 + Documentation/guides/messages/xa1025.md | 42 +++++++++++++++++++ Documentation/release-notes/xa1025.md | 6 +++ .../Properties/Resources.Designer.cs | 9 ++++ .../Properties/Resources.resx | 4 ++ .../Properties/xlf/Resources.cs.xlf | 5 +++ .../Properties/xlf/Resources.de.xlf | 5 +++ .../Properties/xlf/Resources.es.xlf | 5 +++ .../Properties/xlf/Resources.fr.xlf | 5 +++ .../Properties/xlf/Resources.it.xlf | 5 +++ .../Properties/xlf/Resources.ja.xlf | 5 +++ .../Properties/xlf/Resources.ko.xlf | 5 +++ .../Properties/xlf/Resources.pl.xlf | 5 +++ .../Properties/xlf/Resources.pt-BR.xlf | 5 +++ .../Properties/xlf/Resources.ru.xlf | 5 +++ .../Properties/xlf/Resources.tr.xlf | 5 +++ .../Properties/xlf/Resources.zh-Hans.xlf | 5 +++ .../Properties/xlf/Resources.zh-Hant.xlf | 5 +++ .../Xamarin.Android.Build.Tests/BuildTest.cs | 14 ++++++- .../IncrementalBuildTest.cs | 5 ++- .../Xamarin.Android.Common.targets | 3 ++ 21 files changed, 146 insertions(+), 3 deletions(-) create mode 100644 Documentation/guides/messages/xa1025.md create mode 100644 Documentation/release-notes/xa1025.md diff --git a/Documentation/guides/messages/README.md b/Documentation/guides/messages/README.md index c558263bc1d..4090a915c25 100644 --- a/Documentation/guides/messages/README.md +++ b/Documentation/guides/messages/README.md @@ -97,6 +97,7 @@ ms.date: 01/24/2020 + XA1022: Specified reference Java library not found: {file} + [XA1023](xa1023.md): Using the DX DEX Compiler is deprecated. + [XA1024](xa1024.md): Ignoring configuration file 'Foo.dll.config'. .NET configuration files are not supported in Xamarin.Android projects that target .NET 5 or higher. ++ [XA1025](xa1025.md): The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. ## XA2xxx: Linker diff --git a/Documentation/guides/messages/xa1025.md b/Documentation/guides/messages/xa1025.md new file mode 100644 index 00000000000..4b348118c86 --- /dev/null +++ b/Documentation/guides/messages/xa1025.md @@ -0,0 +1,42 @@ +--- +title: Xamarin.Android error XA1025 +description: XA1025 error code +ms.date: 07/27/2020 +--- +# Xamarin.Android error XA1025 + +## Example messages + +``` +error XA1025: The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. +``` + +## Issue + +The project has the `AndroidAotMode` MSBuild property set to the experimental +`Hybrid` value and also includes the value `armeabi-v7a` in the +`AndroidSupportedAbis` MSBuild property. Applications built with +`AndroidAotMode` set to `Hybrid` currently abort during startup on `armeabi-v7a` +devices, so the build exits with an error if this configuration is found. + +## Solution + +If armeabi-v7a device compatibility is required for the app, the +`AndroidAotMode` MSBuild property must be set to `Normal` or removed from the +project file completely. To adjust the value of the `AndroidAotMode` MSBuild +property, edit the project file in a text editor. + +If armeabi-v7a device compatibility is not required for the app, then deselect +the **armeabi-v7a** target ABI in the Visual Studio project property pages to +resolve the build error. + +In Visual Studio, the target ABIs can be adjusted under **Supported +architectures** in the **Advanced** section of the **Android Options** tab of +the project property pages + +In Visual Studio for Mac, the target ABIs can be adjusted under **Supported +ABIs** in the **Advanced** tab of the **Android Build** section of the project +property pages. + +Alternatively, edit the project file in a text editor and remove `armeabi-v7a` +from the `AndroidSupportedAbis` MSBuild property by hand. diff --git a/Documentation/release-notes/xa1025.md b/Documentation/release-notes/xa1025.md new file mode 100644 index 00000000000..e8163eff61b --- /dev/null +++ b/Documentation/release-notes/xa1025.md @@ -0,0 +1,6 @@ +#### Application and library build and deployment + +- Projects using the experimental `Hybrid` value for the `AndroidAotMode` + MSBuild property in combination with the armeabi-v7a target ABI did not yet + produce a build error to help indicate that they would abort during startup + in armeabi-v7a ABI device environments. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 19355e082f2..cafadfe2cfa 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -600,6 +600,15 @@ internal static string XA1024 { } } + /// + /// Looks up a localized string similar to The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.. + /// + internal static string XA1025 { + get { + return ResourceManager.GetString("XA1025", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released.. /// diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index 4f01e366726..f763e13f950 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -407,6 +407,10 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf index ae9ae7a27e1..e6e67ae56e5 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. V sestavení {0} se zjistilo, že se používá AppDomain.CreateDomain(). .NET 5 bude podporovat jen jednu doménu AppDomain, proto toto rozhraní API už nebude po vydání rozhraní .NET 5 v Xamarin.Androidu k dispozici. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf index 8545859bfac..305b6b81e99 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. In der Assembly "{0}" wurde die Verwendung von "AppDomain.CreateDomain()" festgestellt. .NET 5 unterstützt nur eine einzelne AppDomain, sodass diese API nach dem Release von .NET 5 nicht mehr in Xamarin.Android verfügbar ist. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf index 9d4550bee6f..dcccda3e424 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. Se detectó el uso de AppDomain.CreateDomain() en el ensamblado: {0}. En .NET 5 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 5. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf index cc492cf190a..bba99684cdb 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. Utilisation de AppDomain.CreateDomain() détectée dans l'assembly {0}. .NET 5 prend uniquement en charge un seul AppDomain. Cette API ne sera donc plus disponible dans Xamarin.Android après la publication de .NET 5. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf index 155381d673e..eba1545dc46 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. È stato rilevato l'uso di AppDomain.CreateDomain() nell'assembly: {0}. .NET 5 supporterà solo un'unica istanza di AppDomain, di conseguenza questa API non sarà più disponibile in Xamarin.Android dopo il rilascio di .NET 5. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf index 55c698aad46..573dc209901 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. アセンブリ {0} で AppDomain.CreateDomain() が使用されていることが検出されました。.NET 5 では単一の AppDomain のみがサポートされる予定のため、.NET 5 がリリースされるとこの API は Xamarin.Android では使用できなくなります。 diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf index ccb06bb5099..b2ea1d1633c 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. {0} 어셈블리에서 AppDomain.CreateDomain() 사용이 검색되었습니다. .NET 5는 단일 AppDomain만 지원하므로 .NET 5가 릴리스되면 이 API는 Xamarin.Android에서 더는 사용할 수 없습니다. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf index 09f97844ed6..775f2dd7f2a 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pl.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. Wykryto użycie metody AppDomain.CreateDomain() w następującym zestawie: {0}. Program .NET 5 obsługuje tylko jeden obiekt AppDomain, dlatego ten interfejs API nie będzie już dostępny w interfejsie Xamarin.Android po wydaniu programu .NET 5. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf index e50c550315a..61d77378a1f 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.pt-BR.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. O uso de AppDomain.CreateDomain() foi detectado no assembly: {0}. O .NET 5 dá suporte apenas a um único AppDomain, portanto, essa API não estará mais disponível no Xamarin.Android quando o .NET 5 for lançado. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf index bdd01dcc893..453b1cee01f 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ru.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. В сборке обнаружено использование AppDomain.CreateDomain(): {0}. .NET 5 поддерживает только один домен AppDomain, поэтому этот API не будет доступен в Xamarin.Android после выпуска .NET 5. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf index 2519b53226c..bd199c731ed 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.tr.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. Bütünleştirilmiş kodda AppDomain.CreateDomain() metodunun kullanıldığı saptandı: {0}. .NET 5 yalnızca tek bir AppDomain'i destekleyeceğinden bu API, .NET 5 yayımlandıktan sonra artık Xamarin.Android içinde kullanılamayacak. diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf index 0ca413c8464..e38ac230e5e 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hans.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. 在程序集 {0} 中检测到使用了 AppDomain.CreateDomain()。.NET 5 将仅支持一个 AppDomain,因此 .NET 5 发布后,将无法再在 Xamarin.Android 中使用此 API。 diff --git a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf index e1240238aa1..7968136b5a2 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf +++ b/src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.zh-Hant.xlf @@ -354,6 +354,11 @@ 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: .NET, Xamarin.Android. {0} - The file name such as 'Foo.dll.config' + + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property. + The following are literal names and should not be translated: 'Hybrid', 'AndroidAotMode', armeabi-v7a, 'AndroidSupportedAbis' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 5 will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 5 is released. 在下列組件中偵測到使用 AppDomain.CreateDomain(): {0}。.NET 5 只支援單一 AppDomain,因此在 .NET 5 發行之後,此 API 就無法再於 Xamarin.Android 中使用。 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 089af041486..67581c2d205 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 @@ -4290,7 +4290,7 @@ public void XA4310 ([Values ("apk", "aab")] string packageFormat) } [Test] - public void HybridAOT () + public void HybridAOT ([Values ("armeabi-v7a;arm64-v8a", "armeabi-v7a", "arm64-v8a")] string abis) { var proj = new XamarinAndroidApplicationProject () { IsRelease = true, @@ -4299,8 +4299,20 @@ public void HybridAOT () proj.SetProperty ("AndroidAotMode", "Hybrid"); // So we can use Mono.Cecil to open assemblies directly proj.SetProperty ("AndroidEnableAssemblyCompression", "False"); + proj.SetAndroidSupportedAbis (abis); using (var b = CreateApkBuilder ()) { + + if (abis.Contains ("armeabi-v7a")) { + b.ThrowOnBuildFailure = false; + Assert.IsFalse (b.Build (proj), "Build should have failed."); + string error = b.LastBuildOutput + .SkipWhile (x => !x.StartsWith ("Build FAILED.")) + .FirstOrDefault (x => x.Contains ("error XA1025:")); + Assert.IsNotNull (error, "Build should have failed with XA1025."); + return; + } + b.Build (proj); var apk = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}.apk"); 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 a7284f56c9f..f1ee87c8ce9 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 @@ -862,13 +862,13 @@ void AssertAssemblyFilesInFileWrites (XamarinAndroidApplicationProject proj, Pro /* supportedAbis */ "arm64-v8a", /* androidAotMode */ "Full", // None, Normal, Hybrid, Full /* aotAssemblies */ true, - /* expectedResult */ false, + /* expectedResult */ true, }, new object[] { /* supportedAbis */ "arm64-v8a", /* androidAotMode */ "Full", // None, Normal, Hybrid, Full /* aotAssemblies */ false, - /* expectedResult */ false, + /* expectedResult */ true, }, new object[] { /* supportedAbis */ "arm64-v8a", @@ -899,6 +899,7 @@ public void BuildIncrementalAot (string supportedAbis, string androidAotMode, bo BundleAssemblies = false, AotAssemblies = aotAssemblies, }; + proj.SetAndroidSupportedAbis (supportedAbis); if (!string.IsNullOrEmpty (androidAotMode)) proj.SetProperty ("AndroidAotMode", androidAotMode); using (var b = CreateApkBuilder (path)) { diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index b62574e2e5a..77fd1214f6e 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -2184,6 +2184,9 @@ because xbuild doesn't support framework reference assemblies. Condition=" '%(_BuildTargetAbis.Identity)' == 'armeabi' " Text="Invalid value 'armeabi' in %24(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties to remove the old value. If the properties page does not show an 'armeabi' checkbox, un-check and re-check one of the other ABIs and save the changes." /> +