Xamarin Monogame app crashes in release mode on startup

0

I've been working on a cross platform game for a couple of years now and am almost at the end. I've run several betas through Google Play without any major issues, until today.

I'm not sure when this issue crept in, but I found out yesterday that Release builds for the Android version of my game no longer works. I had added nuget packages for admob and Google Wallet but after removing all of these, the issue persists. The game will start and then immediately end.

Here are my Android Options

Android Options

I've removed all code shrinking and pro guard configs. I've tried no linking at all. I have tried virtually every combination of options for the release build, they all end the same way, except for one which I will get to in a sec. I've enabled debugging for release, there is no difference. I've cleaned and deleted the objs and bin folders.

here is the log cat, with some bolded parts that I think are interesting

Time Device Name Type PID Tag Message
06-07 14:41:15.057 Google Pixel 4 Debug 828 Zygote Forked child process 28051
06-07 14:41:15.848 Google Pixel 4 Warning 1351 ActivityManager setHasOverlayUi called on unknown pid: 28051
06-07 14:41:15.788 Google Pixel 4 Info 1351 libprocessgroup Successfully killed process cgroup uid 10238 pid 28051 in 0ms
06-07 14:41:15.787 Google Pixel 4 Info 1351 ActivityManager Process com.bwendt.warkandwimble (pid 28051) has died: vis+99 TOP
06-07 14:41:15.783 Google Pixel 4 Info 828 Zygote Process 28051 exited due to signal 6 (Aborted)
06-07 14:41:15.788 Google Pixel 4 Info 1351 libprocessgroup Successfully killed process cgroup uid 10238 pid 28051 in 0ms
06-07 14:41:15.787 Google Pixel 4 Info 1351 ActivityManager Process com.bwendt.warkandwimble (pid 28051) has died: vis+99 TOP
06-07 14:41:15.783 Google Pixel 4 Info 828 Zygote Process 28051 exited due to signal 6 (Aborted)
06-07 14:41:15.630 Google Pixel 4 Error 28096 DEBUG pid: 28051, tid: 28051, name: t.warkandwimble >>> com.bwendt.warkandwimble <<<
06-07 14:41:15.624 Google Pixel 4 Info 28096 crash_dump64 performing dump of process 28051 (target tid = 28051)
06-07 14:41:15.630 Google Pixel 4 Error 28096 DEBUG pid: 28051, tid: 28051, name: t.warkandwimble >>> com.bwendt.warkandwimble <<<
06-07 14:41:15.624 Google Pixel 4 Info 28096 crash_dump64 performing dump of process 28051 (target tid = 28051)
06-07 14:41:15.623 Google Pixel 4 Info 1037 received crash request for pid 28051
06-07 14:41:15.623 Google Pixel 4 Info 1037 received crash request for pid 28051

**06-07 14:41:15.598 Google Pixel 4 Error 28051 libc Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28051 (t.warkandwimble), pid 28051 (t.warkandwimble)**

**06-07 14:41:15.598 Google Pixel 4 Error 28051 libc Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 28051 (t.warkandwimble), pid 28051 (t.warkandwimble)**

**06-07 14:41:15.598 Google Pixel 4 Error 28051 * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/mini/method-to-ir.c:12332, condition var->opcode == OP_REGOFFSET' not met** 

**06-07 14:41:15.598 Google Pixel 4 Error 28051 * Assertion at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mono/mini/method-to-ir.c:12332, conditionvar->opcode == OP_REGOFFSET' not met**

06-07 14:41:15.553 Google Pixel 4 Debug 28051 MonoGame GraphicsDeviceManager.ResetClientBounds: newClientBounds={X:0 Y:31 Width:2148 Height:1017}
06-07 14:41:15.553 Google Pixel 4 Debug 28051 MonoGame GraphicsDeviceManager.ResetClientBounds: newClientBounds={X:0 Y:31 Width:2148 Height:1017}
06-07 14:41:15.514 Google Pixel 4 Verbose 28051 GL Supported Extensions

06-07 14:41:15.514 Google Pixel 4 Verbose 28051 GL Supported Extensions
GL_OES_EGL_image
GL_OES_EGL_image_external
GL_OES_EGL_sync
GL_OES_vertex_half_float
GL_OES_framebuffer_object
GL_OES_rgb8_rgba8
GL_OES_compressed_ETC1_RGB8_texture
GL_AMD_compressed_ATC_texture
GL_KHR_texture_compression_astc_ldr
GL_KHR_texture_compression_astc_hdr
GL_OES_texture_compression_astc
GL_OES_texture_npot
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_format_BGRA8888
GL_EXT_read_format_bgra
GL_OES_texture_3D
GL_EXT_color_buffer_float
GL_EXT_color_buffer_half_float
GL_QCOM_alpha_test
GL_OES_depth24
GL_OES_packed_depth_stencil
GL_OES_depth_texture
GL_OES_depth_texture_cube_map
GL_EXT_sRGB
GL_OES_texture_float
GL_OES_texture_float_linear
GL_OES_texture_half_float
GL_OES_texture_half_float_linear
GL_EXT_texture_type_2_10_10_10_REV
GL_EXT_texture_sRGB_decode
GL_EXT_texture_format_sRGB_override
GL_OES_element_index_uint
GL_EXT_copy_image
GL_EXT_geometry_shader
GL_EXT_tessellation_shader
GL_OES_texture_stencil8
GL_EXT_shader_io_blocks
GL_OES_shader_image_atomic
GL_OES_sample_variables
GL_EXT_texture_border_clamp
GL_EXT_EGL_image_external_wrap_modes
GL_EXT_multisampled_render_to_texture
GL_EXT_multisampled_render_to_texture2
GL_OES_shader_multisample_interpolation
GL_EXT_texture_cube_map_array
GL_EXT_draw_buffers_indexed
GL_EXT_gpu_shader5
06-07 14:41:15.503 Google Pixel 4 Verbose 28051 GL Bound ES
06-07 14:41:15.503 Google Pixel 4 Verbose 28051 GL Bound ES
06-07 14:41:15.499 Google Pixel 4 Verbose 28051 GL Loading Entry Points
06-07 14:41:15.499 Google Pixel 4 Verbose 28051 GL Loading Entry Points
06-07 14:41:15.494 Google Pixel 4 Verbose 28051 AndroidGameView Created GLES 3.2 Context
06-07 14:41:15.494 Google Pixel 4 Verbose 28051 AndroidGameView Created GLES 3.2 Context
06-07 14:41:15.492 Google Pixel 4 Verbose 28051 AndroidGameView Creating GLES 3.2 Context

**06-07 14:41:15.492 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGL.so Not Found!**

06-07 14:41:15.492 Google Pixel 4 Verbose 28051 AndroidGameView Creating GLES 3.2 Context
06-07 14:41:15.492 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGL.so Not Found!
06-07 14:41:15.489 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv3.so
06-07 14:41:15.489 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv3.so
06-07 14:41:15.489 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv2.so
06-07 14:41:15.489 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv2.so
06-07 14:41:15.487 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv1_CM.so
06-07 14:41:15.487 Google Pixel 4 Info 28051 mono-stdout FuncLoader.LoadLibrary libGLESv1_CM.so
06-07 14:41:15.475 Google Pixel 4 Verbose 28051 AndroidGameView Selected Config : Red:8 Green:8 Blue:8 Alpha:8 Depth:24 Stencil:0
06-07 14:41:15.475 Google Pixel 4 Verbose 28051 AndroidGameView EglChooseConfig returned True and 1
06-07 14:41:15.472 Google Pixel 4 Verbose 28051 AndroidGameView Checking Config : Red:8 Green:8 Blue:8 Alpha:8 Depth:24 Stencil:0
06-07 14:41:15.475 Google Pixel 4 Verbose 28051 AndroidGameView Selected Config : Red:8 Green:8 Blue:8 Alpha:8 Depth:24 Stencil:0
06-07 14:41:15.475 Google Pixel 4 Verbose 28051 AndroidGameView EglChooseConfig returned True and 1
06-07 14:41:15.472 Google Pixel 4 Verbose 28051 AndroidGameView Checking Config : Red:8 Green:8 Blue:8 Alpha:8 Depth:24 Stencil:0
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 10 lines
Red:0 Green:0 Blue:0 Alpha:0 Depth:0 Stencil:0
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 10 lines
Red:0 Green:0 Blue:0 Alpha:0 Depth:0 Stencil:0
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 2 lines
Red:10 Green:10 Blue:10 Alpha:10 Depth:10 Stencil:10
Red:0 Green:0 Blue:0 Alpha:0 Depth:0 Stencil:0
Red:10 Green:10 Blue:10 Alpha:10 Depth:10 Stencil:10
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 2 lines
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 2 lines
Red:16 Green:16 Blue:16 Alpha:16 Depth:16 Stencil:16
Red:10 Green:10 Blue:10 Alpha:10 Depth:10 Stencil:10
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 3 lines
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:16 Green:16 Blue:16 Alpha:16 Depth:16 Stencil:16
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 2 lines
Red:16 Green:16 Blue:16 Alpha:16 Depth:16 Stencil:16
Red:10 Green:10 Blue:10 Alpha:10 Depth:10 Stencil:10
06-07 14:41:15.472 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 3 lines
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:16 Green:16 Blue:16 Alpha:16 Depth:16 Stencil:16
06-07 14:41:15.471 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 26 lines
Red:8 Green:8 Blue:8 Alpha:8 Depth:8 Stencil:8
Red:8 Green:8 Blue:8 Alpha:8 Depth:8 Stencil:8
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
Red:5 Green:5 Blue:5 Alpha:5 Depth:5 Stencil:5
Red:4 Green:4 Blue:4 Alpha:4 Depth:4 Stencil:4
06-07 14:41:15.471 Google Pixel 4 Info 28051 chatty uid=10238(com.bwendt.warkandwimble) identical 26 lines
06-07 14:41:15.466 Google Pixel 4 Verbose 28051 AndroidGameView Device Supports
Red:8 Green:8 Blue:8 Alpha:8 Depth:8 Stencil:8
Red:8 Green:8 Blue:8 Alpha:8 Depth:8 Stencil:8
06-07 14:41:15.466 Google Pixel 4 Verbose 28051 AndroidGameView Device Supports
06-07 14:41:15.381 Google Pixel 4 Info 28051 Adreno PFP: 0x016ee185, ME: 0x00000000
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Build Config : S P 8.0.6 AArch64
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Reconstruct Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Remote Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Remote Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Local Branch : AU124
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno OpenGL ES Shader Compiler Version: EV031.26.06.00
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Build Date : 06/30/19
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno QUALCOMM build : 9b214d0, Ibc75db1fca
06-07 14:41:15.381 Google Pixel 4 Info 28051 Adreno PFP: 0x016ee185, ME: 0x00000000
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Build Config : S P 8.0.6 AArch64
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Reconstruct Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Remote Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Remote Branch :
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Local Branch : AU124
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno OpenGL ES Shader Compiler Version: EV031.26.06.00
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno Build Date : 06/30/19
06-07 14:41:15.379 Google Pixel 4 Info 28051 Adreno QUALCOMM build : 9b214d0, Ibc75db1fca
06-07 14:41:15.162 Google Pixel 4 Warning 28051 monodroid-gc GREF GC Threshold: 46080
06-07 14:41:15.162 Google Pixel 4 Warning 28051 monodroid-gc GREF GC Threshold: 46080
06-07 14:41:15.148 Google Pixel 4 Warning 28051 monodroid Using runtime path: /data/app/com.bwendt.warkandwimble-acn2LyBZKZZQJ3eKXYKTLw==/lib/arm64
06-07 14:41:15.148 Google Pixel 4 Warning 28051 monodroid Using runtime path: /data/app/com.bwendt.warkandwimble-acn2LyBZKZZQJ3eKXYKTLw==/lib/arm64
06-07 14:41:15.135 Google Pixel 4 Warning 28051 t.warkandwimbl JIT profile information will not be recorded: profile file does not exits.
06-07 14:41:15.135 Google Pixel 4 Warning 28051 t.warkandwimbl JIT profile information will not be recorded: profile file does not exits.
06-07 14:41:15.134 Google Pixel 4 Warning 28051 t.warkandwimbl JIT profile information will not be recorded: profile file does not exits.
06-07 14:41:15.134 Google Pixel 4 Warning 28051 t.warkandwimbl JIT profile information will not be recorded: profile file does not exits.
06-07 14:41:15.128 Google Pixel 4 Warning 28051 ActivityThread Application com.bwendt.warkandwimble can be debugged on port 8100...
06-07 14:41:15.128 Google Pixel 4 Warning 28051 ActivityThread Application com.bwendt.warkandwimble can be debugged on port 8100...
06-07 14:41:15.113 Google Pixel 4 Error 28051 t.warkandwimbl Not starting debugger since process cannot load the jdwp agent.
06-07 14:41:15.113 Google Pixel 4 Error 28051 t.warkandwimbl Not starting debugger since process cannot load the jdwp agent.
06-07 14:41:15.060 Google Pixel 4 Info 1351 ActivityManager Start proc 28051:com.bwendt.warkandwimble/u0a238 for activity {com.bwendt.warkandwimble/crc649c108853a05368f6.Activity1}
06-07 14:41:15.057 Google Pixel 4 Debug 828 Zygote Forked child process 28051
06-07 14:41:15.060 Google Pixel 4 Info 1351 ActivityManager Start proc 28051:com.bwendt.warkandwimble/u0a238 for activity {com.bwendt.warkandwimble/crc649c108853a05368f6.Activity1}

There is one option that makes a difference. Logcat is posting alot of things twice for some reason. There is also a LibGL.so not found error, but the debug version spits out that same error so I dont think its an issue.

If I enabled Use Shared Runtime, I get a different error

Time Device Name Type PID Tag Message
06-07 13:20:49.011 Google Pixel 4 Error 21050 AndroidRuntime **java.lang.UnsatisfiedLinkError**: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/base.apk", zip file "/data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/split_config.arm64_v8a.apk", zip file "/data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/lib/arm64, /data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/base.apk!/lib/arm64-v8a, /data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/com.bwendt.warkandwimble-oV0qWM2OiTzyPIl6tYu-QA==/split_config.xxhdpi.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]] 
**couldn't find "libxamarin-debug-app-helper.so"**

at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:74)
at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:48)
at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Force finishing activity com.bwendt.warkandwimble/crc649c108853a05368f6.Activity1

Maybe the above error is the same as this one just with less information? I dont know why a release build without debugging would want to load libxamarin-debug-app-helper.so

c#
android
xamarin
monogame
asked on Stack Overflow Jun 8, 2020 by Ben W

1 Answer

0

Okay I have figured out the problem, but not yet a solution.

I am using some extensions for XElement to make it easier to parse some data. Here's an example one of the extension signatures I created:

public T ReadAttribute<T>(XElement element, string attributeName) where T : new()
{
    if (string.IsNullOrEmpty(attributeName))
    {
        return new T();
    }

    XAttribute attribute = element.Attribute(attributeName);

    if (attribute == null)
    {
        return new T();
    }
    else
    {
        try
        {
            if (typeof(T).GetTypeInfo().IsEnum)
            {
                return (T)Enum.Parse(typeof(T), attribute.Value);
            }
            else
            {
                return (T)Convert.ChangeType(attribute.Value, typeof(T), CultureInfo.InvariantCulture);
            }

        }
        catch (Exception)
        {
            return new T();
        }
    }
}

This method reads an XElement for a particular name and returns a new object if the attribute isn't found.

I eventually traced the problem to the where T : new() constraint with structs. If I remove this constraint, the app will again run in Release mode. I have Linking currently set to None. With this constraint, the app only works in debug mode. In Release it will write Error 28051 libc Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in the logcat as soon as the method is called, exiting and throwing no exceptions.

Is this an Android Xamarin bug? Not sure how to proceed.

answered on Stack Overflow Jun 13, 2020 by Ben W

User contributions licensed under CC BY-SA 3.0