来自崩溃日志Xamarin.iOS的更多详细信息

来自崩溃日志Xamarin.iOS的更多详细信息,xamarin.ios,crash,Xamarin.ios,Crash,我的一个试飞用户每次加载应用程序时都会遇到崩溃。我无法在我的测试设备或模拟器上重现这一点 我有坠机报告,我相信我已经充分说明了这一点 但是,我无法将错误映射回我的代码: Date/Time: 2017-09-04 20:37:34.8879 +0100 Launch Time: 2017-09-04 20:36:50.5258 +0100 OS Version: iPhone OS 10.2.1 (14D27) Report Version:

我的一个试飞用户每次加载应用程序时都会遇到崩溃。我无法在我的测试设备或模拟器上重现这一点

我有坠机报告,我相信我已经充分说明了这一点

但是,我无法将错误映射回我的代码:

Date/Time:           2017-09-04 20:37:34.8879 +0100
Launch Time:         2017-09-04 20:36:50.5258 +0100
OS Version:          iPhone OS 10.2.1 (14D27)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGABRT)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000185433014 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001854fb450 pthread_kill + 112 (pthread.c:1366)
2   libsystem_c.dylib               0x00000001853a7400 abort + 140 (abort.c:91)
3   planit                          0x0000000101235da8 mono_handle_native_crash (mini-exceptions.c:2548)
4   libsystem_platform.dylib        0x00000001854f5348 _sigtramp + 52 (sigtramp.c:115)
5   libsystem_pthread.dylib         0x00000001854fb450 pthread_kill + 112 (pthread.c:1366)
6   libsystem_c.dylib               0x00000001853a7400 abort + 140 (abort.c:91)
7   planit                          0x0000000101333414 xamarin_printf (runtime.m:2218)
8   planit                          0x0000000101271a9c mono_invoke_unhandled_exception_hook (exception.c:1084)
9   planit                          0x00000001012359e4 mono_handle_exception_internal (mini-exceptions.c:1886)
10  planit                          0x0000000101234a84 mono_handle_exception (mini-exceptions.c:2117)
11  planit                          0x000000010122d458 mono_arm_throw_exception (exceptions-arm64.c:411)
12  planit                          0x000000010041c278 throw_exception + 168
13  planit                          0x000000010032289c System_Runtime_ExceptionServices_ExceptionDispatchInfo_Throw + 44
14  planit                          0x00000001003252e4 System_Runtime_CompilerServices_AsyncMethodBuilderCore__c__ThrowAsyncb__6_0_object + 84
15  planit                          0x0000000100c2f808 UIKit_UIKitSynchronizationContext__Postc__AnonStorey0__m__0 (UIKitSynchronizationContext.cs:24)
16  planit                          0x0000000100c1be34 Foundation_NSAsyncActionDispatcher_Apply (NSAction.cs:163)
17  planit                          0x00000001003ecc24 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
18  planit                          0x0000000101243010 mono_jit_runtime_invoke (mini-runtime.c:2526)
19  planit                          0x00000001012a7df0 do_runtime_invoke (object.c:2829)
20  planit                          0x00000001012a7d50 mono_runtime_invoke (object.c:2983)
21  planit                          0x00000001000a8204 native_to_managed_trampoline_1(objc_object*, objc_selector*, _MonoMethod**, unsigned int) (registrar.m:25)
22  planit                          0x00000001000a853c -[__MonoMac_NSAsyncActionDispatcher xamarinApplySelector] (registrar.m:4355)
23  Foundation                      0x0000000186f79048 __NSThreadPerformPerform + 340 (NSThread.m:1247)
24  CoreFoundation                  0x0000000186412b5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1943)
25  CoreFoundation                  0x00000001864124a4 __CFRunLoopDoSources0 + 524 (CFRunLoop.c:1989)
26  CoreFoundation                  0x00000001864100a4 __CFRunLoopRun + 804 (CFRunLoop.c:2821)
27  CoreFoundation                  0x000000018633e2b8 CFRunLoopRunSpecific + 444 (CFRunLoop.c:3113)
28  GraphicsServices                0x0000000187df2198 GSEventRunModal + 180 (GSEvent.c:2245)
29  UIKit                           0x000000018c3857fc -[UIApplication _run] + 684 (UIApplication.m:2650)
30  UIKit                           0x000000018c380534 UIApplicationMain + 208 (UIApplication.m:4092)
31  planit                          0x0000000100c6fc10 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/<unknown>:1)
32  planit                          0x0000000100c2de8c UIKit_UIApplication_Main_string___intptr_intptr (UIApplication.cs:79)
33  planit                          0x0000000100c2de4c UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
34  planit                          0x00000001000cbef4 planit_Application_Main_string__ (Main.cs:13)
35  planit                          0x00000001003ecc24 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
36  planit                          0x0000000101243010 mono_jit_runtime_invoke (mini-runtime.c:2526)
37  planit                          0x00000001012a7df0 do_runtime_invoke (object.c:2829)
38  planit                          0x00000001012aa7bc do_exec_main_checked (object.c:4624)
39  planit                          0x000000010122cc68 mono_jit_exec (driver.g.c:1040)
40  planit                          0x0000000101337168 xamarin_main (monotouch-main.m:482)
41  planit                          0x00000001000c75bc main (main.m:79)
42  libdyld.dylib                   0x00000001853215b8 start + 4
日期/时间:2017-09-04 20:37:34.8879+0100
发布时间:2017-09-04 20:36:50.5258+0100
操作系统版本:iPhone操作系统10.2.1(14D27)
报告版本:104
异常类型:EXC\U坏访问(SIGABRT)
异常子类型:0x0000000000000000处的内核地址无效
由以下线程触发:0
线程0名称:
线程0崩溃:
0 libsystem_kernel.dylib 0x0000000185433014_uuupthread_kill+8
1 libsystem_pthread.dylib 0x00000001854fb450 pthread_kill+112(pthread.c:1366)
2 libsystem_c.dylib 0x00000001853a7400中止+140(中止c:91)
3 planit 0x0000000101235da8单声道句柄本机崩溃(小异常。c:2548)
4 libsystem_platform.dylib 0x00000001854f5348_sigtramp+52(sigtramp.c:115)
5 libsystem_pthread.dylib 0x00000001854fb450 pthread_kill+112(pthread.c:1366)
6 libsystem_c.dylib 0x00000001853a7400中止+140(中止c:91)
7 planit 0x0000000101333414 xamarin_printf(runtime.m:2218)
8 planit 0x0000000101271a9c单声道调用未处理异常挂钩(exception.c:1084)
9 planit 0x00000001012359e4单处理异常内部(迷你异常c:1886)
10 planit 0x0000000101234a84单声道句柄异常(迷你异常。c:2117)
11 planit 0x000000010122d458单声道arm抛出异常(exceptions-arm64.c:411)
12 planit 0x000000010041c278抛出异常+168
13 planit 0x000000010032289c系统运行时异常服务异常DispatchInfo抛出+44
14 planit 0x00000001003252e4系统\u运行时\u编译器服务\u异步方法构建器核心\u c\u ThrowAsyncb\u 6\u 0\u对象+84
15 planit 0x0000000100c2f808 UIKit_UIKitSynchronizationContext___邮政___Anostorey0___m_0(UIKitSynchronizationContext.cs:24)
16 planit 0x0000000100c1be34基金会申请(NSAction.cs:163)
17 planit 0x00000001003ecc24包装器\u运行时\u调用\u对象\u运行时\u调用\u动态\u intptr\u intptr\u intptr\u intptr+244
18 planit 0x0000000101243010 mono\u jit\u运行时调用(mini-runtime.c:2526)
19 planit 0x00000001012a7df0执行运行时调用(object.c:2829)
20 planit 0x00000001012a7d50单声道运行时调用(object.c:2983)
21 planit 0x00000001000a8204本机到托管蹦床1(对象*、对象选择器*、单方法**、无符号整数)(注册商:m:25)
22 planit 0x00000001000a853c-[\uuu MonoMac\u NSAsyncActionDispatcher xamarinApplySelector](register.m:4355)
23基金会0x000 000,186F79048,NSTReCopPrimeExp+ 340(NStult.M: 1247)
24 CoreFoundation 0x0000000186412b5c\uuu CFRUNLOOP\u正在调用\u OUT\u以执行\u函数\uuuu24(CFRUNLOOP.c:1943)
25 CoreFoundation 0x00000001864124a4_uucfrunloopdosources0+524(CFRunLoop.c:1989)
26 CoreFoundation 0x00000001864100a4\uu CFRunLoop+804(CFRunLoop.c:2821)
27 CoreFoundation 0x000000018633e2b8 CFRunLoopRunSpecific+444(CFRunLoop.c:3113)
28图形服务0x0000000187df2198 GSEventRunModal+180(GSEvent.c:2245)
29 UIKit 0x000000018c3857fc-[UIApplication_run]+684(UIApplication.m:2650)
30 UIKit 0x000000018c380534 UIApplicationMain+208(UIApplication.m:4092)
31 planit 0x0000000100c6fc10包装器\u托管\u到\u本机\u UIKit\u UIApplication\u UIApplicationMain\u int\u字符串\u intptr\u intptr(/:1)
32 planit 0x0000000100c2de8c UIKit_UIApplication_Main_string_uuuintptr_intptr(UIApplication.cs:79)
33 planit 0x0000000100c2de4c UIKit_UIApplication_Main_字符串_字符串_字符串(UIApplication.cs:63)
34 planit 0x00000001000cbef4 planit_应用程序_Main_字符串_(Main.cs:13)
35 planit 0x00000001003ecc24包装器\u运行时\u调用\u对象\u运行时\u调用\u动态\u intptr\u intptr\u intptr\u intptr+244
36 planit 0x0000000101243010 mono\u jit\u运行时调用(mini-runtime.c:2526)
37 planit 0x00000001012a7df0执行运行时调用(object.c:2829)
38计划0x00000001012aa7bc执行主检查(对象c:4624)
39 planit 0x000000010122cc68 mono\U jit\U exec(驱动程序g.c:1040)
40 planit 0x0000000101337168 xamarin_main(单触式main.m:482)
41 planit 0x00000001000c75bc干管(干管m:79)
42 libdyld.dylib 0x00000001853215b8启动+4

有人能给我指出正确的方向吗?

我们跟踪导致应用程序崩溃的异常的方法是挂接iOS的全局异常处理程序,并使用我们编写的类将信息记录到IO

类别:

using System;
using System.IO;
using UIKit;

namespace namespace.TestingLogs
{
    public static class ApplicationLog
    {
        private static string _filename = "LogFile-";

        public static void CreateFile(string SessionFilename)
        {
            _filename += SessionFilename;

            var docs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            var filename = Path.Combine(docs, _filename);
            var Device = UIDevice.CurrentDevice;
            File.AppendAllText(filename, ("======Device Information======" + Environment.NewLine));
            File.AppendAllText(filename, ("Battery Level: " + Device.BatteryLevel + Environment.NewLine));
            File.AppendAllText(filename, ("Model: " + Device.Model + Environment.NewLine));
            File.AppendAllText(filename, ("System Version: " + Device.SystemVersion + Environment.NewLine));
            File.AppendAllText(filename, ("[" + DateTime.UtcNow.ToString() + "]" + "======Start Log======" + Environment.NewLine + Environment.NewLine));
            Console.WriteLine("[] = " + filename);
        }

        public static void AppendFile(string appendText)
        {
            var txt = Environment.NewLine + appendText;

            var docs = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            var filename = Path.Combine(docs, _filename);
            File.AppendAllText(filename, txt);
        }
    }

    public class ExitAppException : Exception
    {
        public ExitAppException() { }
        public ExitAppException(string message) : base(message) { }
        public ExitAppException(string message, Exception inner) :
        base(message, inner)
        { }
    }
}
通过在“FinishedLaunching”方法中执行以下操作,钩住AppDelegate.cs中的全局未处理事件:

        AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) =>
        {
            try
            {
                //Record the error in our application logs

                ApplicationLog.AppendFile(
                    DateTime.Now.ToString() + "  :  " + "[CRITICAL GLOBALLY HANDLED EXCEPTION] - Critical exception has been hit! - Message: " + e.ExceptionObject +
                        Environment.NewLine + Environment.NewLine +
                            "========= Critcal Error has been hit, application closed =========" +
                                Environment.NewLine + Environment.NewLine
                    );
            }
            catch (Exception genEx)
            {
                var Error = genEx.Message;
            }
        };
显然,使用最适合你的措辞。请随意使用字符串生成器,而不是我们使用它的方式,但一般概念是相同的。您的用户可以下载类似“macgo iphone explorer”(免费)的软件,并访问“应用程序文档”文件夹,日志文件将在其中,因此他们只需通过电子邮件发送给您即可。希望这能帮上忙