【发布时间】:2020-03-26 18:16:22
【问题描述】:
我使用 Xamarin 创建了一个跨平台应用程序。 Android 版本运行良好,但 IOS 版本在应用启动时可能会导致一半用户崩溃。我正在使用 AppCenter 进行错误报告,但它给出了神秘的报告。如何解密此消息并找出我的应用程序似乎无缘无故崩溃的原因?我无法让它在模拟器上崩溃,也无法访问它崩溃的手机。
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018d3c6930 __abort_with_payload + 8
1 libsystem_kernel.dylib 0x000000018d3caec0 abort_with_reason + 24
2 libobjc.A.dylib 0x000000018d314244 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 100
3 libobjc.A.dylib 0x000000018d3141dc _objc_fatal(char const*, ...) + 24
4 libobjc.A.dylib 0x000000018d3114a8 void AutoreleasePoolPage::busted<void (*)(char const*, ...)>(void (*)(char const*, ...)) const + 144
5 libobjc.A.dylib 0x000000018d314a6c AutoreleasePoolPage::busted_die() const + 8
6 libobjc.A.dylib 0x000000018d313520 objc_autoreleasePoolPop + 52
7 CoreFoundation 0x000000018d5dcd40 _CFAutoreleasePoolPop + 24
8 UIKitCore 0x000000019164f4dc _prepareForCAFlush + 116
9 UIKitCore 0x000000019167f770 _afterCACommitHandler + 116
10 CoreFoundation 0x000000018d54de68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
11 CoreFoundation 0x000000018d548d54 __CFRunLoopDoObservers + 412
12 CoreFoundation 0x000000018d549320 __CFRunLoopRun + 1304
13 CoreFoundation 0x000000018d548adc CFRunLoopRunSpecific + 460
14 GraphicsServices 0x00000001974e9328 GSEventRunModal + 100
15 UIKitCore 0x000000019165663c UIApplicationMain + 1932
16 MyApp.iOS 0x00000001018c5330 0x100a04000 + 15471408
17 MyApp.iOS 0x000000010182376c 0x100a04000 + 14808940
18 MyApp.iOS 0x00000001018236f4 0x100a04000 + 14808820
19 MyApp.iOS 0x0000000100a8dc24 0x100a04000 + 564260
20 MyApp.iOS 0x0000000100de3404 0x100a04000 + 4060164
21 MyApp.iOS 0x0000000101ff1d08 0x100a04000 + 22994184
22 MyApp.iOS 0x00000001020afa00 0x100a04000 + 23771648
23 MyApp.iOS 0x00000001020b5cbc 0x100a04000 + 23796924
24 MyApp.iOS 0x0000000101fcfc9c 0x100a04000 + 22854812
25 MyApp.iOS 0x0000000102191f2c 0x100a04000 + 24698668
26 MyApp.iOS 0x0000000100a8db7c 0x100a04000 + 564092
27 libdyld.dylib 0x000000018d3d2360 start + 0
AppDelegate.cs
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
AppCenter.Start("my-secret", typeof(Analytics), typeof(Crashes));
App.screenWidth = (int)UIScreen.MainScreen.Bounds.Width;
App.screenHeight = (int)UIScreen.MainScreen.Bounds.Height;
CrossMediaManager.Current.Init();
HtmlLabelRenderer.Initialize();
Forms.SetFlags("CarouselView_Experimental");
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
Main.cs
static void Main(string[] args) {
try {
UIApplication.Main(args, null, "AppDelegate");
}
catch (Exception e) {
Globals.ReportError(e, "Main.cs", "Main", "Crash");
}
}
(Globals.ReportError 只是 AppCenter 报告的助手。)
【问题讨论】:
-
您是否已将所有 UDID 添加到配置文件中?
-
你是否在info.plist上添加了所有权限,有时在你使用需要权限而你没有添加的东西时会发生这种情况。
标签: c# xamarin xamarin.ios