dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 530 forks source link

[tests] fix nightly APK tests for 32-bit emulators #9308

Closed jonathanpeppers closed 1 month ago

jonathanpeppers commented 1 month ago

Context: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10233028&view=logs&j=16e8a400-d09b-57ea-d2d5-3b6e79259973&t=469522d3-478a-58c1-dd99-cef151b877ac&l=4872

The APK tests on API 21 & 23 (maybe more) emulators fail with:

[BT The app doesn't support ABI architectures of the device. Device ABIs: [x86], app ABIs: [arm64-v8a, x86_64].

Let's build android-x86 as well for all APK tests, to fix this issue.

jonathanpeppers commented 1 month ago

Testing nightly run with:

jonathanpeppers commented 1 month ago

This seems to fix API 21:

image

But API 23 is crashing with:

09-17 14:41:32.933  2758  2758 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/./libSystem.Native'
09-17 14:41:32.933  2758  2758 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/./libSystem.Native'. dlopen failed: library "/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/./libSystem.Native" not found
09-17 14:41:32.933  2758  2758 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/./libSystem.Native'
09-17 14:41:32.933  2758  2758 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/./libSystem.Native'. dlopen failed: library "/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/./libSystem.Native" not found
09-17 14:41:32.933  2758  2758 I monodroid-assembly: Trying to load shared library './libSystem.Native'
09-17 14:41:32.933  2758  2758 I monodroid-assembly: Failed to load shared library './libSystem.Native'. dlopen failed: library "./libSystem.Native" not found
09-17 14:41:32.934  2758  2758 W Mono    : DllImport unable to load library 'libSystem.Native'.
09-17 14:41:33.140  2758  2758 F mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: Nested exception detected.
09-17 14:41:33.140  2758  2758 F mono-rt : Original Exception: at System.Threading.Thread.get_CurrentThread () [0x00009] in <abe84e9d26c94f858f7516774dfbb199>:0
09-17 14:41:33.140  2758  2758 F mono-rt : at System.Threading.Monitor.Exit (object) [0x0000e] in <abe84e9d26c94f858f7516774dfbb199>:0

So, at least more tests are running with this change.

jonathanpeppers commented 1 month ago

There are some test failure related to XamarinLegacySdk("net8.0-android34.0") and ResourceDesignerWithNuGetReference("net8.0-android").

Fixed in: