我陷入困境,WatchKit Extension发生了崩溃,我在互联网上环顾四周,但未能找到理由或任何帮助来修复它。
根据崩溃日志,它说
扩展花了太多时间来初始化
Watch App专为Watch OS1设计,我认为用户在Watch OS2中运行应用程序,花了几个小时进行调试和时间分析后,我无法分析更多。即使我再也无法重现......
我还尝试通过低内存约束中的工具进行时间分析,但在方法调用或系统库中没有任何线索。
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
if (context!=nil)
{
NSString *contextString = (NSString *)context ;
if ([contextString isEqualToString:@"fromHomeScreen"])
{
isFromHomeScreen = YES;
}
else
isFromHomeScreen = NO;
}
NSLog(@"[iWatch]Performance Logs: Main class app First method %@",[NSDate date]);
[self.welcomeLabel setText:NSLocalizedString(@"Welcome", @"")];
[self.tipsLabel setText:NSLocalizedString(@"To control speakers with your watch, set up Wireless Audio Multiroom on your mobile.", @"")];
}
- (void)willActivate {
[super willActivate];
[self setTitle:@""];
[self configureWelcomeForFirstLaunch];}
- (void)configureWelcomeForFirstLaunch {
[self setNotificationObserverForName:kVDWearableSpeakerNoMusic object:nil selector:@selector(checkAndDisplayNextScreenFromWelcomeScreen) observer:self];
[self setNotificationObserverForName:kVDWearableInitialSetupCompleted object:nil selector:@selector(showTipsScreenAfterInitialSetupFinished) observer:self];
[self setNotificationObserverForName:kVDWearableSpeakerCurrentFunctionChanged object:nil selector:@selector(handleOtherSourcesCase) observer:self];
[self setNotificationObserverForName:kVDWearableSpeakerDataUpdated object:nil selector:@selector(UpdateScreenWithCurrentNotification) observer:self];
NSUserDefaults *tempDefault = [[NSUserDefaults alloc] initWithSuiteName:kVDSharedAppGroup];
NSArray *speakerArray = [NSKeyedUnarchiver unarchiveObjectWithData:[tempDefault objectForKey:kVDGetWearableSpeakerData]];
NSDictionary *requst = @{@"firstLaunchStatus":@"currentPlaying", };
NSLog(@"will activate called");
[VDWelcomeInterfaceController openParentApplication:requst reply:^(NSDictionary *replyInfo, NSError *error) {
NSLog(@"replyInfo=%@",replyInfo);
NSLog(@"replyBlockCalled");
if (replyInfo!=nil) {
NSLog(@"gor valid reply without error");
if ([speakerArray count] > 0)
{
if(([replyInfo objectForKey:@"firstLaunchStatus"]) )
{
VDWearableSpeakerData *noMusicDict = [NSKeyedUnarchiver unarchiveObjectWithData:[tempDefault objectForKey:kVDGetWearableSpeakerDataNoMusic]];
VDWearableSpeakerData *speakerData = [NSKeyedUnarchiver unarchiveObjectWithData:[tempDefault objectForKey:kVDGetWearableSelectedSpeakerData]];
if ([speakerData.speakerType isEqualToString:@"Phone speaker"] )
{
return ;
}
if (speakerData.currentFunction.integerValue !=0) {
[VDWelcomeInterfaceController reloadRootControllersWithNames:@[@"HomeInterface", @"VolumeInterface", @"SpeakerInterface"] contexts:[NSArray arrayWithObject:@"noMusic"]];
}
else if ([noMusicDict.noMusic boolValue])
{
// [VDInitialInterfaceController reloadRootControllersWithNames:@[@"VDTipsInterface"] contexts:nil];
[VDWelcomeInterfaceController reloadRootControllersWithNames:@[@"HomeInterface", @"VolumeInterface", @"SpeakerInterface"] contexts:[NSArray arrayWithObject:@"noMusic"]];
NSLog(@"1");
}
else
{
// [VDInitialInterfaceController reloadRootControllersWithNames:@[@"HomeInterface", @"VolumeInterface", @"SpeakerInterface"] contexts:nil];
[VDWelcomeInterfaceController reloadRootControllersWithNames:@[@"HomeInterface", @"VolumeInterface", @"SpeakerInterface"] contexts:[NSArray arrayWithObject:@"music"]];
NSLog(@"2");
}
}
}
}
}];
}
对此例外及其处理的任何明确性都将非常感激。
崩溃日志:事件标识符:5C977759-3AE7-4701-A414-E4E7A27DB34E 硬件型号:iPhone6,2路径:
/private/var/mobile/Containers/Bundle/Application/93509EEB-9945-45CD-9DBD-60E5D1717F4A/Multiroom2-Phone.app/PlugIns/MultiRoom WatchKit Extension.appex / MultiRoom WatchKit扩展标识符:
com.samsung.MultiRoom.watchkitextension版本:3167 (3167)代码类型:ARM-64(Native)父进程:
launchd 1 发布时间:2015-10-27 17:29:57.57 +0100操作系统版本:iOS 9.1(13B143) 报告版本:105 异常类型:EXC_CRASH(SIGABRT)异常子类型:LAUNCH_HANG异常消息:扩展名花费了太多时间 初始化异常注意:由线程触发的EXC_CORPSE_NOTIFY:0 线程0名称:线程0崩溃:0 libsystem_kernel.dylib 0x000000019a8e0a40 mach_msg_trap + 8(syscall_sw.h:105)1
libsystem_kernel.dylib 0x000000019a8e08bc mach_msg + 72 (mach_msg.c:103)2 CoreFoundation 0x0000000185484108 __CFRunLoopServiceMachPort + 196(CFRunLoop.c:2345)3 CoreFoundation 0x0000000185481e0c __CFRunLoopRun + 1032(CFRunLoop.c:727)4
CoreFoundation 0x00000001853b0ca0 CFRunLoopRunSpecific + 384(CFRunLoop.c:2814)5基金会0x00000001863292bc - [NSRunLoop(NSRunLoop)runMode:beforeDate:] + 308 (NSRunLoop.m:367)6基金会 0x000000018637e8f4 - [NSRunLoop(NSRunLoop)运行] +88(NSRunLoop.m:388) 7 libxpc.dylib 0x000000019aa00dac _xpc_objc_main + 660(main.m:177)8 libxpc.dylib 0x000000019aa02ae0 xpc_main + 200(init.c:1369)9基金会 0x00000001864fb194 service_connection_handler + 0 (NSXPCListener.m:129)10 PlugInKit
0x000000019376ecc4 - [PKService run] + 544(PKService.m:104)11 WatchKit 0x000000018b7250c0 main + 872 (main.m:55)12 libdyld.dylib 0x000000019a7de8b8 start + 4(start_glue.s:80) 线程1:0 libsystem_kernel.dylib 0x000000019a8fbb6c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x000000019a9c1530 _pthread_wqthread + 1284(pthread.c:1930)2
libsystem_pthread.dylib 0x000000019a9c1020 start_wqthread + 4 (pthread_asm.s:191) 线程2名称:线程2:0 libsystem_kernel.dylib 0x000000019a8fc4fc kevent_qos + 8 1 libdispatch.dylib
0x000000019a7c0a04 _dispatch_mgr_invoke + 232(source.c:2545)2
libdispatch.dylib 0x000000019a7af874 _dispatch_source_invoke + 0(source.c:777) 线程3:0 libsystem_kernel.dylib 0x000000019a8fbb6c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x000000019a9c1530 _pthread_wqthread + 1284(pthread.c:1930)2
libsystem_pthread.dylib 0x000000019a9c1020 start_wqthread + 4 (pthread_asm.s:191) 主题4: 线程0与ARM线程状态(64位)崩溃: x0:0x0000000010004005 x1:0x0000000007000806 x2:0x0000000000000000 x3:0x0000000000000c00 x4:0x0000000000002507 x5:0x00000000ffffffff x6:0x0000000000000000 x7:0x00000000000000b0 x8:0x00000000fffffbbf x9:0x0000000007000000 x10:0x0000000007000100 x11:0x00000000fff0bdc0 x12:0x0000000000000001 x13:0x0000050000000603 x14:0x0000000000000000 x15: 0x0000060000000600 x16:0xffffffffffffffe1 x17:0x0000000000000000 x18:0x0000000000000000 x19:0x0000000000000000 x20: 0x00000000ffffffff x21:0x0000000000002507 x22:0x0000000000000c00 x23:0x000000016fdfaaf8 x24:0x0000000007000806 x25: 0x0000000000000000 x26:0x0000000007000806 x27:0x0000000000000c00
x28:0x0000000000000001 fp:0x000000016fdfaa00 lr: 0x000000019a8e08bc sp:0x000000016fdfa9b0 pc:0x000000019a8e0a40 cpsr:0x60000000
对此异常及其处理的任何明确性都将非常感激。 提前致谢