I'm running on simulator and the app works fine, but once on an iPhone device it crashes with - An error occured in discoverUserInfo::
The discoverUserInfo is copied code from Apple's CloudKit sample code below. Is this something on Apple's end, or mine?
- (void)discoverUserInfo:(void (^)(CKDiscoveredUserInfo *user))completionHandler {
[self.container fetchUserRecordIDWithCompletionHandler:^(CKRecordID *recordID, NSError *error) {
if (error) {
[self showAlert];
// In your app, handle this error in an awe-inspiring way.
NSLog(@"An error occured in %@: %@", NSStringFromSelector(_cmd), error);
//abort();
} else {
[self.container discoverUserInfoWithUserRecordID:recordID
completionHandler:^(CKDiscoveredUserInfo *user, NSError *error) {
if (error) {
[self showAlert];
// In your app, handle this error deftly.
NSLog(@"An error occured in %@: %@", NSStringFromSelector(_cmd), error);
//abort();
} else {
dispatch_async(dispatch_get_main_queue(), ^(void){
completionHandler(user);
});
}
}];
}
}];
}
The crash logs from the device read:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x31562df0 0x3154e000 + 85488
1 libsystem_pthread.dylib 0x315e3c92 0x315e0000 + 15506
2 libsystem_c.dylib 0x31501934 0x314b8000 + 301364
3 ForCarl 0x0006dc1a 0x2f000 + 257050
4 UIKit 0x2643fcc8 0x26095000 + 3845320
5 UIKit 0x26748cae 0x26095000 + 7027886
6 UIKit 0x2643fc64 0x26095000 + 3845220
7 UIKit 0x26438d88 0x26095000 + 3816840
8 UIKit 0x26439262 0x26095000 + 3818082
9 UIKit 0x26379a46 0x26095000 + 3033670
10 UIKit 0x2637bbd2 0x26095000 + 3042258
11 UIKit 0x261b4f34 0x26095000 + 1179444
12 UIKit 0x260d88de 0x26095000 + 276702
13 UIKit 0x260d84f4 0x26095000 + 275700
14 UIKit 0x260d840a 0x26095000 + 275466
15 QuartzCore 0x25abdfe2 0x25aa7000 + 94178
16 libdispatch.dylib 0x3145ec6c 0x3145d000 + 7276
17 libdispatch.dylib 0x3146a54e 0x3145d000 + 54606
18 CoreFoundation 0x22a09884 0x2293a000 + 850052
19 CoreFoundation 0x22a07fa4 0x2293a000 + 843684
20 CoreFoundation 0x2295399c 0x2293a000 + 104860
21 CoreFoundation 0x229537ae 0x2293a000 + 104366
22 GraphicsServices 0x2a3151a4 0x2a30c000 + 37284
23 UIKit 0x26104630 0x26095000 + 456240
24 ForCarl 0x0006d996 0x2f000 + 256406
25 libdyld.dylib 0x3149caac 0x3149b000 + 6828
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3154f24c 0x3154e000 + 4684
1 libdispatch.dylib 0x3146f4ec 0x3145d000 + 74988
2 libdispatch.dylib 0x3146f21e 0x3145d000 + 74270
Thread 2:
0 libsystem_kernel.dylib 0x3154f49c 0x3154e000 + 5276
1 libsystem_kernel.dylib 0x3154f290 0x3154e000 + 4752
2 CoreFoundation 0x22a097ee 0x2293a000 + 849902
3 CoreFoundation 0x22a07db4 0x2293a000 + 843188
4 CoreFoundation 0x2295399c 0x2293a000 + 104860
5 CoreFoundation 0x2299d366 0x2293a000 + 406374
6 CoreMotion 0x23268a26 0x23223000 + 285222
7 libsystem_pthread.dylib 0x315e2de8 0x315e0000 + 11752
8 libsystem_pthread.dylib 0x315e2d5a 0x315e0000 + 11610
9 libsystem_pthread.dylib 0x315e0b04 0x315e0000 + 2820
Thread 3:
0 libsystem_kernel.dylib 0x315639c0 0x3154e000 + 88512
1 libsystem_pthread.dylib 0x315e0e20 0x315e0000 + 3616
2 libsystem_pthread.dylib 0x315e0af8 0x315e0000 + 2808
Thread 4:
0 libsystem_kernel.dylib 0x315639c0 0x3154e000 + 88512
1 libsystem_pthread.dylib 0x315e0e20 0x315e0000 + 3616
2 libsystem_pthread.dylib 0x315e0af8 0x315e0000 + 2808
Thread 5:
0 libsystem_kernel.dylib 0x315639c0 0x3154e000 + 88512
1 libsystem_pthread.dylib 0x315e0e20 0x315e0000 + 3616
2 libsystem_pthread.dylib 0x315e0af8 0x315e0000 + 2808
Thread 6:
0 libsystem_kernel.dylib 0x315639c0 0x3154e000 + 88512
1 libsystem_pthread.dylib 0x315e0e20 0x315e0000 + 3616
2 libsystem_pthread.dylib 0x315e0af8 0x315e0000 + 2808
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x00000004
r4: 0x00000006 r5: 0x33ea39dc r6: 0x00000000 r7: 0x001fda68
r8: 0x00000000 r9: 0x33ea39dc r10: 0x00000001 r11: 0xc2000000
ip: 0x00000148 sp: 0x001fda5c lr: 0x315e3c97 pc: 0x31562df0
cpsr: 0x00000010
Binary Images:
Try generate new provisioning profile in itunes connect with all certificates you need. Then download them from Xcode preferences, but before doing so, delete the old ones, because it will not be replaced by clicking refresh.
first you have remove provisional profile from Xcode and create new provisional Profile and add then working fine
User contributions licensed under CC BY-SA 3.0