App crashes on launch due to mono.android code throws "System.ArgumentException: Handle must be valid." #5628
Labels
Area: Mono.Android
Issues with the Android API binding (Mono.Android.dll).
Milestone
Steps to Reproduce
In our crash reports we have an exception stacktrace:
QuickActionsView is our custom control registered (by Register attribute) and used in XML as ilive.uicontrols.droid.QuickActionsView (see files in attached archive: QuickActionsView.cs, generated QuickActionsView.java and QuickActionsView_Usage.axml).
QuickActionsView.zip
I've found a few similar issues with "System.ArgumentException: Handle must be valid." error.
But I don't realize whether the issue was solved or not there.
jamesmontemagno/SettingsPlugin#152
xamarin/Essentials#1301
Most of the posts suggest you can suppress the error by changing the GC bridge implementation to the Old version instead of Tarjan by setting an environment variable. For example:
https://stackoverflow.com/questions/61225706/strange-handle-must-be-valid-exception-in-dialog
https://stackoverflow.com/questions/51022450/xamarin-android-cant-set-cg-bridge-to-old-mode-mono-gc-params-bridge-implemen?noredirect=1&lq=1
But I'm not sure how to check my current GC version by VS tools. I don't see anything in my logcat or build output to indicate it's using one bridge or the other. What is the right way to check this?
Expected Behavior
App launches successfully.
Actual Behavior
Crashes during Splash Screen
Version Information
=== Visual Studio Community 2019 for Mac ===
Version 8.8.2 (build 41)
Installation UUID: 617a1f42-f36f-491b-8f59-449405eeefe5
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
=== Mono Framework MDK ===
Runtime:
Mono 6.12.0.107 (2020-02/a22ed3f094e) (64-bit)
Package version: 612000107
=== Roslyn (Language Service) ===
3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa
=== NuGet ===
Version: 5.8.0.6860
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/5.0.100/Sdks
SDK Versions:
5.0.100
3.1.403
3.1.200
3.1.102
3.1.101
3.1.100
3.0.101
3.0.100
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.0
3.1.9
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
2.1.23
2.1.16
2.1.15
2.1.14
2.1.13
=== .NET Core 3.1 SDK ===
SDK: 3.1.403
=== Xamarin.Profiler ===
Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
A valid Xcode installation was not found at the configured location: '/Applications/Xcode.app'
=== Xamarin.Mac ===
Version: 7.0.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:40-0500
=== Xamarin.iOS ===
Version: 14.6.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:41-0500
=== Xamarin Designer ===
Version: 16.8.0.507
Hash: e87b24884
Branch: remotes/origin/d16-8
Build date: 2020-10-29 00:31:38 UTC
=== Xamarin.Android ===
Version: 11.1.0.17 (Visual Studio Community)
Commit: xamarin-android/d16-8/c0e2b8e
Android SDK: /Users/ddp/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
None installed
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.2
Build Information:
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc
=== Microsoft OpenJDK for Mobile ===
Java SDK: /Users/ddp/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:30 UTC
=== Android Device Manager ===
Version: 16.8.0.45
Hash: fc0af5f
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:54 UTC
=== Build Information ===
Release ID: 808020041
Git revision: dba789c00d07d6923cce74016b7e406526d683da
Build date: 2020-11-23 04:40:23-05
Build branch: release-8.8
Xamarin extensions: dba789c00d07d6923cce74016b7e406526d683da
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Mon Aug 31 20:53:32 PDT 2020
root:xnu-4903.278.44~1/RELEASE_X86_64 x86_64
=== Enabled user installed extensions ===
DeepClean 1.2.5
Log File
The text was updated successfully, but these errors were encountered: