Crash immediately after starting after upgrading Visual Studio 2019 to 16.6.0:
W/monodroid-assembly( 6433): typemap: unable to find mapping to a managed type from Java type 'androidx/fragment/app/FragmentManagerImpl'
=================================================================
Native Crash Reporting
=================================================================
Got a SEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
No native Android stacktrace (see debuggerd output).
=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0xccd6c949):0xccd6c939 e8 c2 80 f3 ff 83 c4 10 c7 44 24 20 00 00 00 00 .........D$ ....
0xccd6c949 8b 45 00 8b 40 04 89 44 24 24 83 ec 04 6a 00 8d [email protected]$$...j..
0xccd6c959 44 24 18 50 56 e8 ed d0 f3 ff 89 f9 83 c4 10 85 D$.PV...........
0xccd6c969 c0 8b 54 24 40 0f 84 a1 00 00 00 89 34 24 8b 68 [email protected]$.h
=============================================================
====
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at Java.Interop.TypeManager:monodroid_typemap_java_to_managed <0x00012>
at Java.Interop.TypeManager:GetJavaToManagedType <0x00063>
at Java.Interop.TypeManager:CreateInstance <0x0017f>
at Java.Lang.Object:GetObject <0x0014b>
at Java.Lang.Object:_GetObject <0x000d7>
at Java.Lang.Object:GetObject <0x00063>
at AndroidX.Core.App.ComponentActivity:get_Lifecycle <0x00107>
at AndroidX.Fragment.App.FragmentActivity:get_Lifecycle <0x0003f>
at SequriX.Android.Activities.AppActivity:Fragment.set′ <0x000f8>
at SequriX.Android.Activities.AppActivity:set_Fragment″ <0x0009b>
at ArxOne.MrAdvice.Advice.InnerMethodContext:Invoke <0x00122>
at ArxOne.MrAdvice.Advice.AdviceContext:InvokeNext <0x00051>
at ArxOne.MrAdvice.Advice.SyncAdviceContext:Proceed <0x0003f>
at SequriX.Shared.Helpers.Attributes.AppUiThreadAttribute:Advise <0x000ea>
at ArxOne.MrAdvice.Advice.Method
VS2019 16.6.
No issues with 16.5
References in my project:
Calligraphy, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Java.Interop
JetBrains.Annotations, Version=2019.1.3.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL
Microsoft.AppCenter, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.AppCenter.Analytics, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.AppCenter.Analytics.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.AppCenter.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.AppCenter.Crashes, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.AppCenter.Crashes.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL
Microsoft.CSharp
Mono.Android
MrAdvice, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c0e7e6eab6f293d8, processorArchitecture=MSIL
Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL
NodaTime, Version=2.4.6.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL
SQLitePCLRaw.core, Version=2.0.2.669, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL
SQLitePCLRaw.lib.e_sqlcipher.android, Version=2.0.2.669, Culture=neutral, PublicKeyToken=cdacefa0eb8d9dac, processorArchitecture=MSIL
SQLitePCLRaw.provider.e_sqlcipher, Version=2.0.2.669, Culture=neutral, PublicKeyToken=c242ffa62330c89b, processorArchitecture=MSIL
System
System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL
System.Core
System.Data
System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL
System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
System.ServiceModel
System.Xml
Xamarin.Android.Arch.Core.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Arch.Lifecycle.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Arch.Lifecycle.Runtime, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.Annotations, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.Collections, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.CustomView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.VersionedParcelable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.Android.Support.ViewPager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Activity, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Annotation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Arch.Core.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Arch.Core.Runtime, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.AsyncLayoutInflater, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Collection, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.CoordinatorLayout, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.CursorAdapter, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.CustomView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.DocumentFile, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.DrawerLayout, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Fragment, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.GridLayout, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Interpolator, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Legacy.Support.Core.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Legacy.Support.Core.Utils, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Lifecycle.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Lifecycle.LiveData.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Lifecycle.Runtime, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Lifecycle.ViewModel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Lifecycle.ViewModelSavedState, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Loader, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.LocalBroadcastManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Media, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.MultiDex, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.Print, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.SavedState, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.SlidingPaneLayout, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.SwipeRefreshLayout, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.VectorDrawable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.VectorDrawable.Animated, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.VersionedParcelable, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.AndroidX.ViewPager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL
Xamarin.ANRWatchDog, Version=1.4.25.0, Culture=neutral, processorArchitecture=MSIL
@rgroenewoudt would you be able to create a small sample app which reproduces the issue? I can't diagnose the cause from the information you provided, alas. Thanks!
I'm still trying to create a sample app but I found out that I don't have any issues with <AndroidEnablePreloadAssemblies>True</AndroidEnablePreloadAssemblies>
@rgroenewoudt That's interesting... I will certainly need the sample to figure it out, though. Assembly preloading shouldn't have impact on the way typemaps work. What matters is whether it's a Debug or Release build and the actual contents of the type maps. That's why I need the repro.
App3.zip
Sample app attached. The issue happens when AndroidEnablePreloadAssemblies is turned off in combination with AndroidX in a debug build, tested in emulator.
During debugging I'm also getting messages for various classes from NuGet packages:
W/monodroid-assembly(10427): typemap: unable to find mapping to a managed type from Java type 'uk/co/chrisjenx/calligraphy/CalligraphyLayoutInflater'
@rgroenewoudt These messages are harmless - not all Java types are mapped. The real issue here is a segfault in Mono code, I'm investigating it now.
So, the crash happens because of this line in the Mono runtime. Xamarin.Android runtime uses this code to load a managed type given its name - note that it passes nullptr as the 2nd parameter, which eventually ends up passed to the Mono function mentioned earlier which crashes on the indicated line with:
05-25 14:45:29.392 11029 11029 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4c0 in tid 11029 (ompanyname.app3), pid 11029 (ompanyname.app3)
05-25 14:45:29.420 11058 11058 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
05-25 14:45:29.420 1840 1840 I /system/bin/tombstoned: received crash request for pid 11029
05-25 14:45:29.421 11058 11058 I crash_dump64: performing dump of process 11029 (target tid = 11029)
05-25 14:45:29.427 11058 11058 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-25 14:45:29.427 11058 11058 F DEBUG : Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64:10/QSR1.190920.001/5891938:user/release-keys'
05-25 14:45:29.427 11058 11058 F DEBUG : Revision: '0'
05-25 14:45:29.427 11058 11058 F DEBUG : ABI: 'x86_64'
05-25 14:45:29.427 11058 11058 F DEBUG : Timestamp: 2020-05-25 14:45:29+0200
05-25 14:45:29.427 11058 11058 F DEBUG : pid: 11029, tid: 11029, name: ompanyname.app3 >>> com.companyname.app3 <<<
05-25 14:45:29.427 11058 11058 F DEBUG : uid: 10134
05-25 14:45:29.427 11058 11058 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4c0
05-25 14:45:29.427 11058 11058 F DEBUG : Cause: null pointer dereference
05-25 14:45:29.427 11058 11058 F DEBUG : rax 000000000000002f rbx 0000000000000001 rcx 0000000000000000 rdx 0000000000000030
05-25 14:45:29.427 11058 11058 F DEBUG : r8 0000000000000003 r9 000000000013e2e2 r10 0173eed800000000 r11 0000000000000206
05-25 14:45:29.427 11058 11058 F DEBUG : r12 0000000000000000 r13 00007478530343c0 r14 00007478075eda33 r15 000074780763efb0
05-25 14:45:29.427 11058 11058 F DEBUG : rdi 0000000000000000 rsi 00007478e2cb14d0
05-25 14:45:29.427 11058 11058 F DEBUG : rbp 00007ffef3a35680 rsp 00007ffef3a355d0 rip 0000747807a4066a
05-25 14:45:29.432 1792 2471 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
05-25 14:45:29.432 1792 2471 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
05-25 14:45:29.462 11058 11058 F DEBUG :
05-25 14:45:29.462 11058 11058 F DEBUG : backtrace:
05-25 14:45:29.462 11058 11058 F DEBUG : #00 pc 00000000003ba66a /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (_mono_reflection_get_type_from_info+474)
05-25 14:45:29.462 11058 11058 F DEBUG : #01 pc 00000000003ba3d1 /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (mono_reflection_type_from_name_checked+321)
05-25 14:45:29.462 11058 11058 F DEBUG : #02 pc 00000000003ba26d /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonosgen-2.0.so (mono_reflection_type_from_name+125)
05-25 14:45:29.462 11058 11058 F DEBUG : #03 pc 000000000000ddb5 /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonodroid.so (xamarin::android::internal::EmbeddedAssemblies::typemap_java_to_managed(char const*)+389) (BuildId: 9952f1cfe0d910ae631abc73479f88eef34fd71d)
05-25 14:45:29.462 11058 11058 F DEBUG : #04 pc 000000000000def3 /data/app/com.companyname.app3-aQUF6Ge6_v-WaLb5i8Q7vw==/lib/x86_64/libmonodroid.so (xamarin::android::internal::EmbeddedAssemblies::typemap_java_to_managed(_MonoString*)+99) (BuildId: 9952f1cfe0d910ae631abc73479f88eef34fd71d)
05-25 14:45:29.462 11058 11058 F DEBUG : #05 pc 0000000000069532 <anonymous:5ad25000>
The fix is simple and I'll be opening a PR against Mono soon. It may take a few days to propagate to Xamarin.Android/master, I'll keep this issue updated.
@rgroenewoudt PR for mono/master fixing this issue is up https://github.com/mono/mono/pull/19839
Update Xamarin.AndroidX.Lifecycle to 2.2.0.1 but STILL CRASH with AndroidEnablePreloadAssemblies = False.
There are some update??
@giuseppenovielli, thanks for the question. A fix for the issue has been merged to the development branch but is not yet published within Visual Studio 2019.
If everything goes as planned, this fix will be included in the next versions of Visual Studio 2019 version 16.7 Preview and Visual Studio 2019 for Mac version 8.7 Preview. I will be adding an "In Preview: " milestone to this issue along with a comment as soon as the fix is published in a Preview version.
Here's an example of how the comment will look: https://github.com/xamarin/xamarin-android/issues/4409#issuecomment-615018927.
Thanks again for submitting this issue!
_Release status update_
A new Preview version of Xamarin.Android has now been published that includes the fix for this item. The fix is not yet included in a Release version. I will update this again when a Release version is available that includes the fix.
Fix included in Xamarin.Android 10.4.0.0.
Fix included on Windows in Visual Studio 2019 version 16.7 Preview 3. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.
Fix included on macOS in Visual Studio 2019 for Mac version 8.7 Preview 3. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.
_Release status update_
A new Release version of Xamarin.Android has now been published that includes the fix for this item.
Fix included in Xamarin.Android SDK version 11.0.0.3.
Fix included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the fix, check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/.
Fix included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.
Hi @brendanzagaeski crash still happens after update of VS Mac on debug mode. Release mode working fine.
Also getting this error
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5f656b6f766e59
My VS Mac details down below.
=== Visual Studio Community 2019 for Mac ===
Version 8.7 (build 2037)
Installation UUID: 13ce7c86-f995-46e0-9747-e20145c92d08
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
Package version: 612000089
=== Mono Framework MDK ===
Runtime:
Mono 6.12.0.89 (2020-02/e59c1cd70f4) (64-bit)
Package version: 612000089
=== Roslyn (Language Service) ===
3.7.0-6.20371.12+917b9dfae12e3b6cb266a3c062fb20a1e9d5fb06
=== NuGet ===
Version: 5.7.0.6702
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.1.302/Sdks
SDK Versions:
3.1.302
3.1.301
3.1.300
3.1.202
3.1.200
3.1.102
3.1.101
3.1.100
3.0.101
3.0.100
2.1.701
2.1.700
2.1.505
2.1.504
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.6
3.1.5
3.1.4
3.1.2
3.1.1
3.1.0
3.0.1
3.0.0
2.1.20
2.1.19
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.12
2.1.11
2.1.9
2.1.8
=== Xamarin.Profiler ===
Version: 1.6.12.29
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 11.6 (16141)
Build 11E708
=== Xamarin.Mac ===
Version: 6.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:44:59-0400
=== Xamarin.iOS ===
Version: 13.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:45:00-0400
=== Xamarin Designer ===
Version: 16.7.0.492
Hash: f5afe667d
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-07-10 18:42:54 UTC
=== Xamarin.Android ===
Version: 11.0.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-7/aca845b
Android SDK: /Users/keremozcan/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
6.0 (API level 23)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.5
SDK Build Tools Version: 28.0.3
Build Information:
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f
=== Microsoft OpenJDK for Mobile ===
Java SDK: /Users/keremozcan/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.7.0.13
Hash: 8380518
Branch: remotes/origin/dev/jmt/d16-7readconfig~2
Build date: 2020-07-23 22:38:02 UTC
=== Android Device Manager ===
Version: 16.7.0.18
Hash: 4b44bc1
Branch: remotes/origin/d16-7
Build date: 2020-07-23 22:38:26 UTC
=== Build Information ===
Release ID: 807002037
Git revision: b7706774ff5a1b761a7eb7f2d116d0d2c29ad87c
Build date: 2020-07-31 04:14:15-04
Build branch: release-8.7
Xamarin extensions: b7706774ff5a1b761a7eb7f2d116d0d2c29ad87c
=== Operating System ===
Mac OS X 10.15.5
Darwin 19.5.0 Darwin Kernel Version 19.5.0
Tue May 26 20:41:44 PDT 2020
root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
@krmzcn it's impossible to tell if this is the same issue without stack trace, but I believe you ran across https://github.com/xamarin/xamarin-android/issues/4983 (fixed in https://github.com/xamarin/xamarin-android/pull/4993)
@grendello that's the problem we have facing. Thanks. It worked!