在发布模式下为iOS构建Xamarin.Forms时出错

时间:2017-07-06 08:59:43

标签: xamarin xamarin.ios xamarin.forms

我们开发了适用于iOS和Android的Xamarin Forms应用程序。该应用程序现在已经工作了几个月,并且可以在商店中使用。 但自从我们的应用程序的最后一个发布周期以来,应用程序在启动时崩溃了。 仅在发布模式下发生,仅在实际设备上发生。所有其他组合仍然有效(在模拟器上发布/在设备上调试/ ..)。 我们还试图回滚版本但仍无法构建发布版本。

并且还尝试更改链接器选项。

目前Xamarin或Xcode看起来有变化,但这只是假设。

当我尝试通过Console输出进行调试时,所有内容都会加载,直到它调用iOS项目的Appdelegate中的ApplicationLoad。所以看起来问题出在表单代码中。

我从设备日志中附加了Stacktrace。如果有人想要缩小问题的范围,那就太好了。

提前致谢。

Jul  6 10:30:38 Christians-iPhone SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  6 10:30:38 Christians-iPhone syslogd[25] <Notice>: ASL Sender Statistics
Jul  6 10:30:38 Christians-iPhone SpringBoard[58] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Jul  6 10:30:39 Christians-iPhone kernel[0] <Notice>: xpcproxy[1511] Container: /private/var/mobile/Containers/Data/Application/600896D2-F214-44FA-86AE-246A07E303EB (sandbox)
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Found new TLS offset at 224
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: The app delegate must implement the window property if it wants to use a main storyboard file.
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Mac' (culture: '')
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Mac' (culture: '')
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Deprecated' (culture: '')
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Deprecated' (culture: '')
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Mobile' (culture: '')
Jul  6 10:30:39 Christians-iPhone EasierLife[1511] <Warning>: Xamarin.iOS: Unable to locate assembly 'Akavache.Mobile' (culture: '')
Jul  6 10:30:39 Christians-iPhone SpringBoard[58] <Warning>: BSXPCMessage received error for message: Connection invalid
Jul  6 10:30:39 Christians-iPhone SpringBoard[58] <Warning>: BSXPCMessage received error for message: Connection invalid
Jul  6 10:30:39 Christians-iPhone SpringBoard[58] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Jul  6 10:30:39 Christians-iPhone SpringBoard[58] <Warning>: UNNotificationRegistrarConnectionListener connection invalidated
Jul  6 10:30:39 Christians-iPhone com.apple.xpc.launchd[1] (UIKitApplication:de.easierlife.ambioassist[0x548][1511]) <Notice>: Service exited due to signal: Abort trap: 6
Jul  6 10:30:39 Christians-iPhone diagnosticd[86] <Error>: unable to find offset 0x8458b9a4 in shared cache for arch 'arm64'
Jul  6 10:30:39 Christians-iPhone ReportCrash[1512] <Notice>: platform_thread_get_unique_id matched 524823
Jul  6 10:30:39 Christians-iPhone ReportCrash[1512] <Notice>: Formulating report for corpse[1511] EasierLife


Incident Identifier: 0A3335E6-E745-4DCF-BFB7-311BB924E8E2
CrashReporter Key:   cbb09f8a78d5056bd2a27c35a5ea66615507b95d
Hardware Model:      iPhone7,2
Process:             EasierLife [1472]
Path:                /private/var/mobile/Containers/Bundle/Application/31C00A3A-7F57-41EE-9267-E796C7964815/EasierLife.app/EasierLife
Identifier:          de.easierlife.new
Version:             25 (1.11)
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2017-07-05 18:07:13.13 +0200
Launch Time:         2017-07-05 18:07:12.12 +0200
OS Version:          iOS 9.2.1 (13D15)
Report Version:      105

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

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                  0x184b11900 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x18417ff80 objc_exception_throw + 56
2   CoreFoundation                  0x184b115c0 -[NSException raise] + 12
3   EasierLife                      0x101ac3098 wrapper_managed_to_native_Xamarin_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr (/<unknown>:1)
4   EasierLife                      0x101ab20c0 HockeyApp_iOS_BITHockeyManager_ConvertToNsExceptionAndAbort_object (/<unknown>:1)
5   EasierLife                      0x101ab1f0c HockeyApp_iOS_BITHockeyManager_ThrowExceptionAsNative_object (/<unknown>:1)
6   EasierLife                      0x101ab3d68 HockeyApp_iOS_BITHockeyManager__StartManagerm__0_object_System_UnhandledExceptionEventArgs (/<unknown>:1)
7   EasierLife                      0x1003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
8   EasierLife                      0x101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2509)
9   EasierLife                      0x101c56c4c do_runtime_invoke (object.c:2860)
10  EasierLife                      0x101c59844 call_unhandled_exception_delegate (object.c:4483)
11  EasierLife                      0x101c59398 mono_unhandled_exception (object.c:4577)
12  EasierLife                      0x101bcebcc mono_handle_exception_internal (mini-exceptions.c:1831)
13  EasierLife                      0x101bcdd38 mono_handle_exception (mini-exceptions.c:2126)
14  EasierLife                      0x101bc5cc8 mono_arm_throw_exception (exceptions-arm64.c:408)
15  EasierLife                      0x100425cb8 throw_exception + 168
16  EasierLife                      0x101be020c mono_magic_trampoline (mini-trampolines.c:832)
17  EasierLife                      0x100424d2c generic_trampoline_jit + 252
18  EasierLife                      0x100d47944 EasierLife_EasierLifeApp_InitCache_string (EasierLifeApp.xaml.cs:114)
19  EasierLife                      0x100d479f8 EasierLife_EasierLifeApp__ctor_string (EasierLifeApp.xaml.cs:128)
20  EasierLife                      0x100138524 EasierLife_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary (/<unknown>:1)
21  EasierLife                      0x1003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
22  EasierLife                      0x101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2509)
23  EasierLife                      0x101c56c4c do_runtime_invoke (object.c:2860)
24  EasierLife                      0x101c56ba8 mono_runtime_invoke (object.c:3018)
25  EasierLife                      0x101ad3674 native_to_managed_trampoline_24(objc_object*, objc_selector*, _MonoMethod**, UIApplication*, NSDictionary*, unsigned int) (registrar.m:997)
26  EasierLife                      0x101ad3ecc -[AppDelegate application:didFinishLaunchingWithOptions:] (registrar.m:10219)
27  UIKit                           0x189879704 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400
28  UIKit                           0x189aa8130 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2904
29  UIKit                           0x189aac4b8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1672
30  UIKit                           0x189aa95c0 -[UIApplication workspaceDidEndTransaction:] + 168
31  FrontBoardServices              0x1860c7790 -[FBSSerialQueue _performNext] + 184
32  FrontBoardServices              0x1860c7b10 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
33  CoreFoundation                  0x184ac8efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
34  CoreFoundation                  0x184ac8990 __CFRunLoopDoSources0 + 540
35  CoreFoundation                  0x184ac6690 __CFRunLoopRun + 724
36  CoreFoundation                  0x1849f5680 CFRunLoopRunSpecific + 384
37  UIKit                           0x189872580 -[UIApplication _run] + 460
38  UIKit                           0x18986cd90 UIApplicationMain + 204
39  EasierLife                      0x100c078a4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/<unknown>:1)
40  EasierLife                      0x100b970ac UIKit_UIApplication_Main_string___intptr_intptr (UIApplication.cs:79)
41  EasierLife                      0x100b9706c UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
42  EasierLife                      0x100138264 EasierLife_iOS_Application_Main_string__ (/<unknown>:1)
43  EasierLife                      0x1003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
44  EasierLife                      0x101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2509)
45  EasierLife                      0x101c56c4c do_runtime_invoke (object.c:2860)
46  EasierLife                      0x101c59e70 do_exec_main_checked (object.c:4680)
47  EasierLife                      0x101bc264c mono_jit_exec (driver.g.c:1037)
48  EasierLife                      0x101d09e70 xamarin_main (monotouch-main.m:480)
49  EasierLife                      0x101af8aa0 main (main.m:181)
50  libdyld.dylib                   0x1845968b8 start + 4


Thread 0 name:  tid_b07  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001846b4140 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000018477cef8 pthread_kill + 112
2   libsystem_c.dylib               0x0000000184625dac abort + 140
3   EasierLife                      0x0000000101b82248 -[BITPLCrashReporter generateLiveReportWithThread:] + 0
4   CoreFoundation                  0x0000000184b11c88 __handleUncaughtException + 652
5   libobjc.A.dylib                 0x000000018418023c _objc_terminate() + 112
6   EasierLife                      0x0000000101b6a110 BITCrashUncaughtCXXTerminateHandler() (BITCrashCXXExceptionHandler.mm:181)
7   libc++abi.dylib                 0x0000000184172f44 std::__terminate(void (*)()) + 16
8   libc++abi.dylib                 0x000000018417285c __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9   libobjc.A.dylib                 0x0000000184180094 _objc_exception_destructor(void*) + 0
10  CoreFoundation                  0x0000000184b115c0 -[NSException init] + 0
11  EasierLife                      0x0000000101ac3098 wrapper_managed_to_native_Xamarin_ObjCRuntime_Messaging_void_objc_msgSend_intptr_intptr (/<unknown>:1)
12  EasierLife                      0x0000000101ab20c0 HockeyApp_iOS_BITHockeyManager_ConvertToNsExceptionAndAbort_object (/<unknown>:1)
13  EasierLife                      0x0000000101ab1f0c HockeyApp_iOS_BITHockeyManager_ThrowExceptionAsNative_object (/<unknown>:1)
14  EasierLife                      0x0000000101ab3d68 HockeyApp_iOS_BITHockeyManager__StartManagerm__0_object_System_UnhandledExceptionEventArgs (/<unknown>:1)
15  EasierLife                      0x00000001003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
16  EasierLife                      0x0000000101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2510)
17  EasierLife                      0x0000000101c56c4c do_runtime_invoke (object.c:2860)
18  EasierLife                      0x0000000101c59844 call_unhandled_exception_delegate (object.c:4484)
19  EasierLife                      0x0000000101c59398 mono_unhandled_exception (object.c:4577)
20  EasierLife                      0x0000000101bcebcc mono_handle_exception_internal (mini-exceptions.c:1831)
21  EasierLife                      0x0000000101bcdd38 mono_handle_exception (mini-exceptions.c:2126)
22  EasierLife                      0x0000000101bc5cc8 mono_arm_throw_exception (exceptions-arm64.c:410)
23  EasierLife                      0x0000000100425cb8 throw_exception + 168
24  EasierLife                      0x0000000101be020c mono_magic_trampoline (mini-trampolines.c:834)
25  EasierLife                      0x0000000100424d2c generic_trampoline_jit + 252
26  EasierLife                      0x0000000100d47944 EasierLife_EasierLifeApp_InitCache_string (EasierLifeApp.xaml.cs:115)
27  EasierLife                      0x0000000100d479f8 EasierLife_EasierLifeApp__ctor_string (EasierLifeApp.xaml.cs:130)
28  EasierLife                      0x0000000100138524 EasierLife_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary (/<unknown>:1)
29  EasierLife                      0x00000001003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
30  EasierLife                      0x0000000101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2510)
31  EasierLife                      0x0000000101c56c4c do_runtime_invoke (object.c:2860)
32  EasierLife                      0x0000000101c56ba8 mono_runtime_invoke (object.c:3018)
33  EasierLife                      0x0000000101ad3674 native_to_managed_trampoline_24(objc_object*, objc_selector*, _MonoMethod**, UIApplication*, NSDictionary*, unsigned int) (registrar.m:997)
34  EasierLife                      0x0000000101ad3ecc -[AppDelegate application:didFinishLaunchingWithOptions:] (registrar.m:10219)
35  UIKit                           0x0000000189879704 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400
36  UIKit                           0x0000000189aa8130 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 2904
37  UIKit                           0x0000000189aac4b8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1672
38  UIKit                           0x0000000189aa95c0 -[UIApplication workspaceDidEndTransaction:] + 168
39  FrontBoardServices              0x00000001860c7790 -[FBSSerialQueue _performNext] + 184
40  FrontBoardServices              0x00000001860c7b10 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
41  CoreFoundation                  0x0000000184ac8efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
42  CoreFoundation                  0x0000000184ac8990 __CFRunLoopDoSources0 + 540
43  CoreFoundation                  0x0000000184ac6690 __CFRunLoopRun + 724
44  CoreFoundation                  0x00000001849f5680 CFRunLoopRunSpecific + 384
45  UIKit                           0x0000000189872580 -[UIApplication _run] + 460
46  UIKit                           0x000000018986cd90 UIApplicationMain + 204
47  EasierLife                      0x0000000100c078a4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr (/<unknown>:1)
48  EasierLife                      0x0000000100b970ac UIKit_UIApplication_Main_string___intptr_intptr (UIApplication.cs:79)
49  EasierLife                      0x0000000100b9706c UIKit_UIApplication_Main_string___string_string (UIApplication.cs:63)
50  EasierLife                      0x0000000100138264 EasierLife_iOS_Application_Main_string__ (/<unknown>:1)
51  EasierLife                      0x00000001003efe94 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
52  EasierLife                      0x0000000101bdddf0 mono_jit_runtime_invoke (mini-runtime.c:2510)
53  EasierLife                      0x0000000101c56c4c do_runtime_invoke (object.c:2860)
54  EasierLife                      0x0000000101c59e70 do_exec_main_checked (object.c:4681)
55  EasierLife                      0x0000000101bc264c mono_jit_exec (driver.g.c:1037)
56  EasierLife                      0x0000000101d09e70 xamarin_main (monotouch-main.m:480)
57  EasierLife                      0x0000000101af8aa0 main (main.m:181)
58  libdyld.dylib                   0x00000001845968b8 start + 4

Thread 1:
0   libsystem_kernel.dylib          0x00000001846b4b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000184779530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000184779020 start_wqthread + 4

Thread 2 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 2:
0   libsystem_kernel.dylib          0x00000001846b54fc kevent_qos + 8
1   libdispatch.dylib               0x000000018457894c _dispatch_mgr_invoke + 232
2   libdispatch.dylib               0x00000001845677bc _dispatch_source_invoke + 0

Thread 3:
0   libsystem_kernel.dylib          0x00000001846b4b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000184779530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000184779020 start_wqthread + 4

Thread 4:
0   libsystem_kernel.dylib          0x00000001846b4b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000184779530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000184779020 start_wqthread + 4

Thread 5:
0   libsystem_kernel.dylib          0x00000001846b4440 __semwait_signal + 8
1   libsystem_c.dylib               0x00000001845d122c nanosleep + 212
2   libc++.1.dylib                  0x000000018414a314 std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 84
3   JavaScriptCore                  0x00000001882e5b74 bmalloc::Heap::scavenge(std::__1::unique_lock<bmalloc::StaticMutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 188
4   JavaScriptCore                  0x00000001882e5824 bmalloc::Heap::concurrentScavenge() + 84
5   JavaScriptCore                  0x00000001882e7d64 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::entryPoint() + 100
6   JavaScriptCore                  0x00000001882e7cf4 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::pthreadEntryPoint(void*) + 12
7   libsystem_pthread.dylib         0x000000018477bb28 _pthread_body + 156
8   libsystem_pthread.dylib         0x000000018477ba8c _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000184779028 thread_start + 4

Thread 6 name:  WebThread
Thread 6:
0   libsystem_kernel.dylib          0x00000001846994bc mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000184699338 mach_msg + 72
2   CoreFoundation                  0x0000000184ac8ac0 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x0000000184ac67c4 __CFRunLoopRun + 1032
4   CoreFoundation                  0x00000001849f5680 CFRunLoopRunSpecific + 384
5   WebCore                         0x00000001885a5998 RunWebThread(void*) + 456
6   libsystem_pthread.dylib         0x000000018477bb28 _pthread_body + 156
7   libsystem_pthread.dylib         0x000000018477ba8c _pthread_body + 0
8   libsystem_pthread.dylib         0x0000000184779028 thread_start + 4

Thread 7 name:  SGen worker
Thread 7:
0   libsystem_kernel.dylib          0x00000001846b3f48 __psynch_cvwait + 8
1   libsystem_pthread.dylib         0x000000018477ace8 _pthread_cond_wait + 648
2   EasierLife                      0x0000000101cd76a0 thread_func (mono-os-mutex.h:146)
3   libsystem_pthread.dylib         0x000000018477bb28 _pthread_body + 156
4   libsystem_pthread.dylib         0x000000018477ba8c _pthread_body + 0
5   libsystem_pthread.dylib         0x0000000184779028 thread_start + 4

Thread 8 name:  Finalizer
Thread 8:
0   libsystem_kernel.dylib          0x00000001846994f8 semaphore_wait_trap + 8
1   EasierLife                      0x0000000101c163d8 finalizer_thread (mono-os-semaphore.h:90)
2   EasierLife                      0x0000000101c84994 start_wrapper (threads.c:837)
3   EasierLife                      0x0000000101cec95c inner_start_thread (mono-threads.c:1172)
4   libsystem_pthread.dylib         0x000000018477bb28 _pthread_body + 156
5   libsystem_pthread.dylib         0x000000018477ba8c _pthread_body + 0
6   libsystem_pthread.dylib         0x0000000184779028 thread_start + 4

Thread 9:
0   libsystem_kernel.dylib          0x00000001846b4b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000184779530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000184779020 start_wqthread + 4

Thread 10:
0   libsystem_kernel.dylib          0x00000001846b4b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000184779530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000184779020 start_wqthread + 4

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0xffffffffffffffff
    x4: 0x0000000000000010   x5: 0x0000000000000020   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000008000000   x9: 0x0000000004000000  x10: 0x0000000000003c57  x11: 0x00000001a4714661
   x12: 0x00000001a4714661  x13: 0x0000000000000018  x14: 0x000000008000001f  x15: 0x0000000080000023
   x16: 0x0000000000000148  x17: 0x0000000101e1c300  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x00000001a2269000  x21: 0x00000001545f77f0  x22: 0x000000015494ba00  x23: 0x00000001a2274b68
   x24: 0x00000001a2278000  x25: 0x6e001b5475b35342  x26: 0x000000018a208cf3  x27: 0x0000000184d46b9a
   x28: 0x00000001a130ed30  fp: 0x000000016fdbddf0   lr: 0x000000018477cef8
    sp: 0x000000016fdbddd0   pc: 0x00000001846b4140 cpsr: 0x00000000

PS:在android中一切正常。

编辑:添加了FinishedLaunching方法

  public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
  Locator.CurrentMutable.RegisterConstant(new IOSCookieStore(), typeof(IPlatformCookieStore));

        InitXamarinForms();

  Xamarin.FormsMaps.Init();

  // check for a notification
  if (options != null)
  {
    // check for a local notification
    if (options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey))
    {
      var localNotification = options[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification;
      if (localNotification != null)
      {
        UIAlertController okayAlertController = UIAlertController.Create(localNotification.AlertAction, localNotification.AlertBody, UIAlertControllerStyle.Alert);
        okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));

        GetWindow().RootViewController.PresentViewController(okayAlertController, true, null);

        // reset our badge
        UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
      }
    }
  }

        InitTrackerAndExceptionHandling();
        InitAndRegisterPushNotifications();
        FFImageLoading.Forms.Touch.CachedImageRenderer.Init();

  // Needed for loading the Lib!
  var t = typeof(SignaturePad.Forms.iOS.SignaturePadRenderer);


  var urls = NSFileManager.DefaultManager.GetUrls(NSSearchPathDirectory.CachesDirectory, NSSearchPathDomain.User);
  var path = urls[0].Path;
  string pathToCacheDbFile = System.IO.Path.Combine(path, "EasierLife/BlobCache/blobs.db");

  LoadApplication(new EasierLifeApp(pathToCacheDbFile));


  return base.FinishedLaunching(app, options);
    }

我还在考虑使用akavache进行缓存时出错。 但正如我所提到的,实际上我们在这里没有改变任何东西。

编辑2: 好了,我发现,这是akavache /缓存的问题。在不初始化缓存的情况下,应用程序将重新启动。

public void InitCache() { 
    BlobCache.ApplicationName = "EasierLife";
    BlobCache.EnsureInitialized();  
    _cache = BlobCache.LocalMachine;

}

但我仍然没有回答为什么突然发生这种情况而没有对代码进行任何更改。

1 个答案:

答案 0 :(得分:1)

我终于想通了,问题与我的缓存插件akavache有关。所以我将讨论转移到bug跟踪器上。 link

相关问题