Search code examples
windows-runtimewindows-phone-8.1hockeyapp

HockeyApp crashes on back button press on Windows Phone


HockeyApp crashes on pressing back button when it prompts on app launch and asks for sending/deleting crash logs. A NullReferenceException occurs inside HockeyApp; the stacktrace is attached.

The platform is Windows Phone 8.1 RT and HockeyApp version is 2.2.2

How can I fix this issue in my app?

Stacktrace:

{
    "contact": null,
    "description": null,
    "log": "Package: BuggyApp\nVersion: 1.1.0.0\nOS: Windows Phone\nWindows Phone: 8.1\nManufacturer: Microsoft\nModel: Virtual\nDate: 2015-09-07T10:29:41.6261178Z\nProduct-ID: 00000000-0000-0000-0000-000000000000
            System.NullReferenceException: Object reference not set to an instance of an object.
            at HockeyApp.CrashHandler.<AskUserForAgreementAsync>d__c.MoveNext()
            --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at HockeyApp.CrashHandler.<HandleCrashesAsync>d__0.MoveNext()
            --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at HockeyApp.HockeyClientExtensionsWinUniversal.<SendCrashesAsync>d__0.MoveNext()
            --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
            at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
            at BuggyApp.App.<OnLaunched>d__e.MoveNext()
            --- End of stack trace from previous location where exception was thrown ---
            at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__3(Object state)
            at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()",
    "sdk": "HockeySDKWP81",
    "sdk_version": "2.2.2",
    "userID": null
}

Solution

  • It is bug in the HockeyApp sdk. It was fixed two month ago with this commit. But the lastest version of the sdk (2.2.2) built 8 moth ago.

    So you should wrap SendCrashesAsync invocation with try { //... } catch (NullReferenceException) { } and wait for new build of the sdk.