Visual Studio Enterprise 2017 for Mac
Version 7.5.2 (build 40)
Installation UUID: 1ede8c5d-9d75-419f-82a5-a4e553d2c07f
Runtime:
Mono 5.10.1.57 (2017-12/ea8a24b1bbf) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)
Package version: 510010057
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.0.5
2.0.0
1.1.2
1.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
SDK Versions:
2.1.4
2.0.0
1.0.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.6.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Xamarin.Android
Version: 8.3.3.2 (Visual Studio Enterprise)
Android SDK: /Users/cosminstirbu/Documents/sdk
Supported Android versions:
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 27.0.3
Java SDK: /usr
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Apple Developer Tools
Xcode 9.4 (14160)
Build 9F1027a
Xamarin.Mac
Version: 4.4.1.193 (Visual Studio Enterprise)
Xamarin.iOS
Version: 11.12.0.4 (Visual Studio Enterprise)
Hash: 64fece5f
Branch: d15-7
Build date: 2018-05-29 20:00:44-0400
Xamarin Inspector
Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1
Build Information
Release ID: 705020040
Git revision: cfe2fc0566bc4db990242959de40505a13f58352
Build date: 2018-05-30 11:24:18-04
Xamarin addins: 3ac7413ef51a88e06367313c27aec8f7292752a6
Build lane: monodevelop-lion-d15-7
Operating System
Mac OS X 10.13.5
Darwin 17.6.0 Darwin Kernel Version 17.6.0
Tue May 8 15:22:16 PDT 2018
root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64
Enabled user installed addins
AddinMaker 1.4.2
FileNesting 0.1.1
Macaque Tips 0.1.2
StyleCop Support 1.1.0.0
xUnit.NET 2 testing framework support 0.7.5
Straight8's SpecFlow Integration 1.11.2.0
NDK Version 17.0.4754217
06-18 16:32:26.742 1699-1723/system_process I/ActivityManager: Start proc 8249:com.myapp/u0a86 for activity com.myapp/md56ddbe9b70b1931e00ea94b862e0da07e.SplashActivity
06-18 16:32:26.838 8249-8249/? W/monodroid: Trying to load sgen from: /data/app/com.bca.buyerapp.uat-1/lib/x86_64/libmonosgen-2.0.so
06-18 16:32:26.884 8249-8249/? W/monodroid-gc: GREF GC Threshold: 46080
06-18 16:32:26.885 8249-8249/? W/monodroid: Calling into managed runtime init
06-18 16:32:26.935 8249-8249/? E/mono: Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Java.Interop.JniRuntime' threw an exception. ---> System.ArgumentException: Type provided must be an Enum.
Parameter name: enumType
at System.RuntimeType.GetEnumUnderlyingType () <0x7c1f99569e30 + 0x00049> in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Enum.GetUnderlyingType (System.Type enumType) <0x7c1f9954cb80 + 0x0000e> in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Generic.EqualityComparer`1[T].CreateComparer () [0x000e1] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Generic.EqualityComparer`1[T].get_Default () [0x0000b] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor (System.Int32 concurrencyLevel, System.Int32 capacity, System.Boolean growLockArray, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00072] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor () [0x00006] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at Java.Interop.JniRuntime..cctor () <0x7c1f994540b0 + 0x0001c> in <aa533aa4af8445f3b8f28f77ce0333e9>:0
--- End of inner exception stack trace ---
at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) <0x7c1f989158e0 + 0x00054> in <2b050e7f433043c2acff8fe2c18b5767>:0
at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) <0x7c1f989222c0 + 0x003fc> in <2b050e7f433043c2acff8fe2c18b5767>:0
06-18 16:32:26.935 8249-8249/? E/mono-rt: [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Java.Interop.JniRuntime' threw an exception. ---> System.ArgumentException: Type provided must be an Enum.
Parameter name: enumType
at System.RuntimeType.GetEnumUnderlyingType () <0x7c1f99569e30 + 0x00049> in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Enum.GetUnderlyingType (System.Type enumType) <0x7c1f9954cb80 + 0x0000e> in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Generic.EqualityComparer`1[T].CreateComparer () [0x000e1] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Generic.EqualityComparer`1[T].get_Default () [0x0000b] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor (System.Int32 concurrencyLevel, System.Int32 capacity, System.Boolean growLockArray, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00072] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor () [0x00006] in <31333f1e9cc74ec2914f4912ea8af6e7>:0
at Java.Interop.JniRuntime..cctor () <0x7c1f994540b0 + 0x0001c> in <aa533aa4af8445f3b8f28f77ce0333e9>:0
--- End of inner exception stack trace ---
at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) <0x7c1f989158e0 + 0x00054> in <2b050e7f433043c2acff8fe2c18b5767>:0
at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) <0x7c1f989222c0 + 0x003fc> in <2b050e7f433043c2acff8fe2c18b5767>:0
06-18 16:32:26.986 1402-1402/? I/Zygote: Process 8249 exited cleanly (1)
06-18 16:32:26.989 1699-1798/system_process I/ActivityManager: Process com.myapp (pid 8249) has died
06-18 16:32:26.989 1699-1798/system_process D/ActivityManager: cleanUpApplicationRecord -- 8249
06-18 16:32:26.996 8266-8266/? W/art: Unexpected CPU variant for X86 using defaults: x86_64
If I enable x86 as well and install it on a x86 emulator, then it works.
I can verify this behavior on VS Windows 15.7.4, just using a File | New Project.
If I follow the stacktrace, starting in JniRuntime:
Then to ConcurrentDictionary:
Then to EqualityComparer:
I believe this is an issue w/ Mono + AOT + LLVM, but it only breaks when you enable LLVM.
What happens in my app is a white screen and an infinite loop, prints this forever:
06-21 15:47:28.547 11060 11060 W monodroid: Trying to load sgen from: /data/app/App11.App11-XFpzxChsxZgmpMo-aG5EVg==/lib/x86_64/libmonosgen-2.0.so
06-21 15:47:28.576 11060 11060 W monodroid-gc: GREF GC Threshold: 46080
06-21 15:47:28.577 11060 11060 W monodroid: Calling into managed runtime init
06-21 15:47:28.638 11060 11060 E mono :
06-21 15:47:28.638 11060 11060 E mono : Unhandled Exception:
06-21 15:47:28.638 11060 11060 E mono : System.TypeInitializationException: The type initializer for 'Java.Interop.JniRuntime' threw an exception. ---> System.ArgumentException: Type provided must be an Enum.
06-21 15:47:28.638 11060 11060 E mono : Parameter name: enumType
06-21 15:47:28.638 11060 11060 E mono : at System.RuntimeType.GetEnumUnderlyingType () <0x7f77a81e7820 + 0x00049> in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at System.Enum.GetUnderlyingType (System.Type enumType) <0x7f77a81d2410 + 0x0000e> in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at System.Collections.Generic.EqualityComparer`1[T].CreateComparer () [0x000e1] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at System.Collections.Generic.EqualityComparer`1[T].get_Default () [0x0000b] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor (System.Int32 concurrencyLevel, System.Int32 capacity, System.Boolean growLockArray, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00072] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor () [0x00006] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.638 11060 11060 E mono : at Java.Interop.JniRuntime..cctor () <0x7f77a7d913a0 + 0x0002f> in <434b82f8517242e1a62de1b2f307acb0>:0
06-21 15:47:28.638 11060 11060 E mono : --- End of inner exception stack trace ---
06-21 15:47:28.638 11060 11060 E mono : at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) <0x7f77a8085090 + 0x00054> in <0016f5ff79dc42a49f85fb633845eca1>:0
06-21 15:47:28.638 11060 11060 E mono : at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) <0x7f77a8091a70 + 0x003fc> in <0016f5ff79dc42a49f85fb633845eca1>:0
06-21 15:47:28.639 11060 11060 E mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Java.Interop.JniRuntime' threw an exception. ---> System.ArgumentException: Type provided must be an Enum.
06-21 15:47:28.639 11060 11060 E mono-rt : Parameter name: enumType
06-21 15:47:28.639 11060 11060 E mono-rt : at System.RuntimeType.GetEnumUnderlyingType () <0x7f77a81e7820 + 0x00049> in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at System.Enum.GetUnderlyingType (System.Type enumType) <0x7f77a81d2410 + 0x0000e> in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at System.Collections.Generic.EqualityComparer`1[T].CreateComparer () [0x000e1] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at System.Collections.Generic.EqualityComparer`1[T].get_Default () [0x0000b] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor (System.Int32 concurrencyLevel, System.Int32 capacity, System.Boolean growLockArray, System.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00072] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue]..ctor () [0x00006] in <830f0909a25c4660924694f1d0e1dc39>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at Java.Interop.JniRuntime..cctor () <0x7f77a7d913a0 + 0x0002f> in <434b82f8517242e1a62de1b2f307acb0>:0
06-21 15:47:28.639 11060 11060 E mono-rt : --- End of inner exception stack trace ---
06-21 15:47:28.639 11060 11060 E mono-rt : at Android.Runtime.AndroidRuntime..ctor (System.IntPtr jnienv, System.IntPtr vm, System.Boolean allocNewObjectSupported, System.IntPtr classLoader, System.IntPtr classLoader_loadClass) <0x7f77a8085090 + 0x00054> in <0016f5ff79dc42a49f85fb633845eca1>:0
06-21 15:47:28.639 11060 11060 E mono-rt : at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) <0x7f77a8091a70 + 0x003fc> in <0016f5ff79dc42a49f85fb633845eca1>:0
It's likely crashing the activity on start, and repeats by restarting the activity.
same issue on VS 16.0.4
/cc @alexanderkyte I saw you've been working on AOT for Android lately.
I tried this one again with Visual Studio 2019 16.1.1, and a Xamarin.Android "Hello World" built in Release mode causes this: App12.zip
Install this on an x86_64 emulator to see it, thanks!
Quick note if anybody is interested : I did do a test on a Pixelbook (which supports x86_64 Android applications) and they are affected by the exact same issue (not that surprising really, it's pretty much the exact same code no matter what, it's just that this issue causes crashes on real devices, albeit a very small percentage)
I think I'm running into the same problem. A user reported that on their Chromebook, my app stopped launching (and it just displays a white screen) right after they received the update where I added x86 and x86_64 builds.
I tried my app on a cheap Chromebook I have and it worked, but my cheap Chromebook is an x86 Chromebook. The user's Chromebook is running x64 (verified by using a benchmark app).
I confirm that the problem is still occuring on the latest stable version with the same kind of logs.
Oddly enough I'm not hitting this specific issue anymore on a Hello World project... I'm running Windows, VS 16.3.9, with Xamarin.Android 10.0.6.2, and the latest Android NDK (20.1.5948944). App built with AOT+LLVM and compiled for x86_64 deployed to an x86_64 emulator is working fine.
However, I am facing issues with a more complex (real) app with otherwise the same setup, as described in #3986. In my real app, with LLVM enabled and compiled for x86_64 and running on x86_64, some things just randomly don't work as expected, causing my app to not work, super strange.
any news?
Any updates?
I've been able to reproduce @jonathanpeppers 's issue - it seems to be happening when initializing an equality comparer for a custom value type.
Here is the repository with the sample app which crashes only with AOT + LLVM and x86_64: https://github.com/akravch/mono_aot_llvm
https://github.com/akravch/mono_aot_llvm/blob/master/MonoAotLlvm/MainActivity.cs#L20
I was experiencing a very similar problem in issue #4291. It's a bit frustrating to see that even though this has been known for over 2 years, there seems to be no efforts to fix it.
In my case, there is no equality comparer needed in order for the issue to occur.
Turning off LLVM and increasing the app size by over 25% for the majority of my users is not viable workaround for me.
I (and many of my app users) would highly appreciate if this could get fixed!
Most helpful comment
I can verify this behavior on VS Windows 15.7.4, just using a
File | New Project.If I follow the stacktrace, starting in
JniRuntime:https://github.com/xamarin/java.interop/blob/3acf556b0e39b9863953e6f18277a5e6f36a6aa1/src/Java.Interop/Java.Interop/JniRuntime.cs#L92
Then to
ConcurrentDictionary:https://github.com/mono/mono/blob/43b0fa6261b6a264a846da9a9358be9050d510b2/mcs/class/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs#L178
Then to
EqualityComparer:https://github.com/mono/mono/blob/43b0fa6261b6a264a846da9a9358be9050d510b2/mcs/class/referencesource/mscorlib/system/collections/generic/equalitycomparer.cs#L88
I believe this is an issue w/ Mono + AOT + LLVM, but it only breaks when you enable LLVM.
What happens in my app is a white screen and an infinite loop, prints this forever:
It's likely crashing the activity on start, and repeats by restarting the activity.