Xamarin Monogame应用在发布模式下启动时崩溃。

问题描述 投票:0回答:1

我一直在开发一款跨平台游戏,已经有几年了,快到尾声了。我已经通过Google Play运行了几个测试版,没有出现任何重大问题,直到今天。

我不知道这个问题是什么时候出现的,但我昨天发现我的游戏的安卓版本的Release builds不再工作了。我曾为admob和Google Wallet添加了nuget包,但在删除所有这些之后,问题依然存在。游戏会开始,然后立即结束。

以下是我的Android选项

Android Options

我已经删除了所有代码收缩和亲卫配置。我试过完全不链接。我已经尝试了几乎所有的发布版本的选项组合,它们都以同样的方式结束,除了一个我将在几秒钟内得到的。我已经启用了发布版的调试功能,但没有任何区别。我已经清理并删除了objs和bin文件夹。

这里是日志猫,一些我认为有趣的部分被加粗了

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}

有一个选项是有区别的。Logcat因为某些原因把很多东西都发了两次,还有一个LibGL.so not found的错误,但是调试版也会吐出同样的错误,所以我不认为这是一个问题。还有一个LibGL.so not found的错误,但调试版也会吐出同样的错误,所以我不认为这是一个问题。

如果我启用了Use Shared Runtime,我得到了一个不同的错误。

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

也许上面的错误和这个错误是一样的,只是信息少了点?我不知道为什么一个没有调试的发行版要加载libxamarin-debug-app-helper.so。

c# android xamarin monogame
1个回答
0
投票

好吧,我已经找出了问题,但还没有解决方案。

我正在使用XElement的一些扩展,以使其更容易解析一些数据。下面是我创建的一个扩展签名的例子。

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();
        }
    }
}

这个方法读取一个XElement的特定名称 如果没有找到属性就返回一个新的对象。

我最终将问题追溯到了 其中T : new() 结构的约束。如果我删除这个约束,应用程序将再次以Release模式运行。我将Linking当前设置为None。有了这个约束,应用程序只能在调试模式下运行。 在Release模式下,它将写入 错误28051 libc 致命信号6(SIGABRT),代码-1(SI_QUEUE) 在logcat中,只要方法被调用,就会退出,并且不会抛出异常。

这是Android Xamarin的bug吗?不知道该如何处理。

© www.soinside.com 2019 - 2024. All rights reserved.