Xamarin.ios MvvmCross vnext-初始化IMvxGeoLocationWatcher问题

Xamarin.ios MvvmCross vnext-初始化IMvxGeoLocationWatcher问题,xamarin.ios,xamarin,mvvmcross,Xamarin.ios,Xamarin,Mvvmcross,继续进入vnext的旅程 我现在可以构建整个解决方案并成功运行它。但是,当我尝试初始化IMvxGeoLocationWatcher时,它崩溃了。代码和输出是- private IMvxGeoLocationWatcher _geoWatcher; public void StartGettingLocation(Action<MvxCoordinates> response) { Log.Info("LocationService->StartGettingLocat

继续进入vnext的旅程

我现在可以构建整个解决方案并成功运行它。但是,当我尝试初始化IMvxGeoLocationWatcher时,它崩溃了。代码和输出是-

private IMvxGeoLocationWatcher _geoWatcher;

public void StartGettingLocation(Action<MvxCoordinates> response)
{
    Log.Info("LocationService->StartGettingLocation");

    // crashes on this line -
    if (_geoWatcher == null) _geoWatcher = this.GetService<IMvxGeoLocationWatcher>();
================================================================= 执行本机代码时收到SIGABRT。这通常表明 mono运行时或某个本机库中出现致命错误

由您的应用程序使用。
谢谢你的帮助。

没有内部的例外,很难知道出了什么问题-抱歉

我猜在初始化geowatcher时会出现一些问题,可能是因为:

  • 插件未注册
  • 在调用
    cirrial.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded()之前,先调用这一行
  • 或者是因为某些“特定于应用程序的原因”
教程应用程序使用以下位置插件:

教程对你有用吗?如果是这样的话,那么你可能需要比较一下两者

如果崩溃持续存在,则可能: -如果可以,发布内部异常? -或者发布一个演示问题的小型回购——我肯定需要比这两行代码片段中看到的更多的代码



很抱歉缺少文档。我现在正在努力为新发布的v3创建合适的文档和教程,但这些都是自费的

真诚的道歉这里斯图尔特-在我的努力,使它建立(我的最后一篇文章,你亲切地指出了正确的方向我)我评论了一个关键的代码行,并没有记得恢复它。显然你的回答让我意识到了!现在它工作得很好-期待着探索vnext框架的其余部分,特别是插件。
0   MyApp                      0x0007bf6c mono_handle_native_sigsegv + 284
1   MyApp                      0x000c01ad sigabrt_signal_handler + 109
2   libsystem_c.dylib                   0x9a5da59b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   libsystem_sim_c.dylib               0x0297457b abort + 140
5   MyApp                      0x001ed17b monotouch_unhandled_exception_handler + 283
6   MyApp                      0x00077dbc mono_invoke_unhandled_exception_hook + 140
7   MyApp                      0x0007bbda mono_handle_exception_internal + 4154
8   MyApp                      0x0007bd2f mono_handle_exception + 47
9   MyApp                      0x000bce22 mono_x86_throw_exception + 306
10  ???                                 0x07f30f8f 0x0 + 133369743
11  ???                                 0x0bad1a5d 0x0 + 195893853
12  ???                                 0x0bad13dd 0x0 + 195892189
13  ???                                 0x0bad1164 0x0 + 195891556
14  ???                                 0x0bad112c 0x0 + 195891500
15  ???                                 0x11b0a360 0x0 + 296788832
16  ???                                 0x11b09fca 0x0 + 296787914
17  ???                                 0x11b09de2 0x0 + 296787426
18  ???                                 0x11b09cf4 0x0 + 296787188
19  ???                                 0x11b09c65 0x0 + 296787045
20  ???                                 0x11b09b60 0x0 + 296786784
21  ???                                 0x11b09a5c 0x0 + 296786524
22  ???                                 0x11b099c4 0x0 + 296786372
23  ???                                 0x07fe2059 0x0 + 134094937
24  MyApp                      0x00008732 mono_jit_runtime_invoke + 722
25  MyApp                      0x0014f39e mono_runtime_invoke + 126
26  MyApp                      0x001e6296 monotouch_trampoline + 3686
27  UIKit                               0x00a4b817 -[UIViewController loadViewIfRequired] + 536
28  UIKit                               0x00a4b882 -[UIViewController view] + 33
29  UIKit                               0x00a4bb2a -[UIViewController contentScrollView] + 36
30  UIKit                               0x00a62ef5 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36
31  UIKit                               0x00a62fdb -[UINavigationController _layoutViewController:] + 43
32  UIKit                               0x00a63286 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 254
33  UIKit                               0x00a63381 -[UINavigationController _startTransition:fromViewController:toViewController:] + 72
34  UIKit                               0x00a63eab -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
35  UIKit                               0x00a63fc9 -[UINavigationController _startDeferredTransitionIfNeeded] + 41
36  UIKit                               0x00a64055 -[UINavigationController __viewWillLayoutSubviews] + 33
37  UIKit                               0x00b693ab -[UILayoutContainerView layoutSubviews] + 233
38  UIKit                               0x009ba92d -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 279
39  libobjc.A.dylib                     0x022086b0 -[NSObject performSelector:withObject:] + 70
40  QuartzCore                          0x01952fc0 -[CALayer layoutSublayers] + 240
41  QuartzCore                          0x0194733c _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 468
42  QuartzCore                          0x01952eaf -[CALayer layoutIfNeeded] + 166
43  UIKit                               0x00a598cd -[UIViewController window:setupWithInterfaceOrientation:] + 242
44  UIKit                               0x009a21a6 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5346
45  UIKit                               0x009a0cbf -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
46  UIKit                               0x009a0bd9 -[UIWindow _setRotatableViewOrientation:duration:force:] + 89
47  UIKit                               0x0099fe34 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 224
48  UIKit                               0x0099fc6e -[UIWindow _updateToInterfaceOrientation:duration:force:] + 209
49  UIKit                               0x009a0a29 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 853
50  UIKit                               0x009a3922 -[UIWindow setDelegate:] + 351
51  UIKit                               0x00a4dfec -[UIViewController _tryBecomeRootViewControllerInWindow:] + 164
52  UIKit                               0x0099abc4 -[UIWindow addRootViewControllerViewIfPossible] + 481
53  UIKit                               0x0099adbf -[UIWindow _setHidden:forced:] + 368
54  UIKit                               0x0099af55 -[UIWindow _orderFrontWithoutMakingKey] + 49
55  UIKit                               0x009a3f67 -[UIWindow makeKeyAndVisible] + 65
56  ???                                 0x11aee564 0x0 + 296674660
57  ???                                 0x11b099a8 0x0 + 296786344
58  ???                                 0x0bad24ee 0x0 + 195896558
59  ???                                 0x0bad25df 0x0 + 195896799
60  MyApp                      0x00008732 mono_jit_runtime_invoke + 722
61  MyApp                      0x0014f39e mono_runtime_invoke + 126
62  MyApp                      0x001e6296 monotouch_trampoline + 3686
63  UIKit                               0x009677b7 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 266
64  UIKit                               0x00967da7 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1248
65  UIKit                               0x00968fab -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 805
66  UIKit                               0x0097a315 -[UIApplication handleEvent:withNewEvent:] + 1022
67  UIKit                               0x0097b24b -[UIApplication sendEvent:] + 85
68  UIKit                               0x0096ccf8 _UIApplicationHandleEvent + 9874
69  GraphicsServices                    0x02c98df9 _PurpleEventCallback + 339
70  GraphicsServices                    0x02c98ad0 PurpleEventCallback + 46
71  CoreFoundation                      0x01f34bf5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
72  CoreFoundation                      0x01f34962 __CFRunLoopDoSource1 + 146
73  CoreFoundation                      0x01f65bb6 __CFRunLoopRun + 2118
74  CoreFoundation                      0x01f64f44 CFRunLoopRunSpecific + 276
75  CoreFoundation                      0x01f64e1b CFRunLoopRunInMode + 123
76  UIKit                               0x009687da -[UIApplication _run] + 774
77  UIKit                               0x0096a65c UIApplicationMain + 1211
78  ???                                 0x0bacf84c 0x0 + 195885132
79  ???                                 0x0bace218 0x0 + 195879448
80  ???                                 0x0bacdfb0 0x0 + 195878832
81  ???                                 0x0bace03f 0x0 + 195878975
82  MyApp                      0x00008732 mono_jit_runtime_invoke + 722
83  MyApp                      0x0014f39e mono_runtime_invoke + 126
84  MyApp                      0x001534c4 mono_runtime_exec_main + 420
85  MyApp                      0x00157ff5 mono_runtime_run_main + 725
86  MyApp                      0x000651a5 mono_jit_exec + 149
87  MyApp                      0x001db7b5 main + 2005
88  MyApp                      0x000021f5 start + 53