我尝试使用上面的标题进行了许多搜索,并且对我的搜索做了很多建议,但无法解决问题。当我在iPad上建立监狱时,我的应用程序崩溃了。但是设备不是越狱它起作用了。调用以下函数是崩溃的原因:
-(void)btnLoginPressed:(id)sender {
[[MoboAccesstoken ActiveAccessToken] setMoboAccessTokenDelegate:self];
if (![[MoboAccesstoken ActiveAccessToken]isOpened]){
[MoboSDK openActiveSessionWithCompletion:^(NSDictionary *data) {
NSLog(@"data: %@", data);
}];
}
}
并且堆栈跟踪是:
2014-06-05 13:11:39.749 g1[1687:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'
*** First throw call stack:
(0x355e988f 0x3320d259 0x355e9789 0x355e97ab 0x3499d4c9 0x71af33 0x71cb3f 0x71b893 0x71c8bf 0x1ae2f9 0x2c619f 0x4054ef 0x15dea3 0xca883 0xcf5ab 0x558dcd 0x6a73cd 0x2a5a9f 0x30399f 0x4ba2bb 0x4ba365 0x4ab929 0x4abd4b 0x4abd71 0x2c50fd 0x334c47 0x32d0392b 0x32d03319 0x32ce9695 0x32ce8f3b 0x332db22b 0x355bd523 0x355bd4c5 0x355bc313 0x3553f4a5 0x3553f36d 0x332da439 0x32d17cd5 0xa1167 0x99de8)
terminate called throwing an exception
崩溃日志的图像:
Incident Identifier: 0F14065E-394E-43C4-8B6C-007CF55EDAEA
CrashReporter Key: 975f6d2f7ff682cc1bad50cfed0e860f0502f830
Hardware Model: iPad1,1
Process: TestMoboSDK-Client [294]
Path: /var/mobile/Applications/077E9D1E-0594-45F1-8A23-154B630B8FDB/TestMoboSDK-Client.app/TestMoboSDK-Client
Identifier: TestMoboSDK-Client
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2014-06-05 18:38:04.276 +0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x357d688f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x333fa259 objc_exception_throw + 32
2 CoreFoundation 0x357d6789 +[NSException raise:format:arguments:] + 100
3 CoreFoundation 0x357d67ab +[NSException raise:format:] + 34
4 Foundation 0x34b8a4c9 -[NSPlaceholderString initWithString:] + 92
5 TestMoboSDK-Client 0x000f4921 0xe8000 + 51489
6 TestMoboSDK-Client 0x000f05c1 0xe8000 + 34241
7 TestMoboSDK-Client 0x000f4283 0xe8000 + 49795
8 UIKit 0x3310360b _UIXXRemoteNotificationRegistrationSucceeded + 146
9 UIKit 0x331040dd _XRemoteNotificationRegistrationSucceeded + 116
10 AppSupport 0x33ce5af9 migHelperRecievePortCallout + 148
11 CoreFoundation 0x357aa523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
12 CoreFoundation 0x357aa4c5 __CFRunLoopDoSource1 + 140
13 CoreFoundation 0x357a9313 __CFRunLoopRun + 1370
14 CoreFoundation 0x3572c4a5 CFRunLoopRunSpecific + 300
15 CoreFoundation 0x3572c36d CFRunLoopRunInMode + 104
16 GraphicsServices 0x334c7439 GSEventRunModal + 136
17 UIKit 0x32f04cd5 UIApplicationMain + 1080
18 TestMoboSDK-Client 0x000f6c0f 0xe8000 + 60431
19 TestMoboSDK-Client 0x000ee008 0xe8000 + 24584
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3584c32c __pthread_kill + 8
1 libsystem_c.dylib 0x34a34208 pthread_kill + 48
2 libsystem_c.dylib 0x34a2d298 abort + 88
3 libc++abi.dylib 0x35044f64 abort_message + 40
4 libc++abi.dylib 0x35042346 default_terminate() + 18
5 libobjc.A.dylib 0x333fa350 _objc_terminate + 140
6 libc++abi.dylib 0x350423be safe_handler_caller(void (*)()) + 70
7 libc++abi.dylib 0x3504244a std::terminate() + 14
8 libc++abi.dylib 0x3504381e __cxa_rethrow + 82
9 libobjc.A.dylib 0x333fa2a2 objc_exception_rethrow + 6
10 CoreFoundation 0x3572c506 CFRunLoopRunSpecific + 398
11 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
12 GraphicsServices 0x334c7432 GSEventRunModal + 130
13 UIKit 0x32f04cce UIApplicationMain + 1074
14 TestMoboSDK-Client 0x000f6c08 0xe8000 + 60424
15 TestMoboSDK-Client 0x000ee000 0xe8000 + 24576
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3583c3a8 kevent + 24
1 libdispatch.dylib 0x33b6fea4 _dispatch_mgr_invoke + 708
2 libdispatch.dylib 0x33b6fbc2 _dispatch_mgr_thread + 30
Thread 2:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x3584c0d8 __psynch_mutexwait + 24
1 libsystem_c.dylib 0x349e9674 pthread_mutex_lock + 376
2 WebCore 0x373cf4e8 _WebTryThreadLock(bool) + 208
3 WebCore 0x373cf7ec WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 24
4 CoreFoundation 0x357aab14 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
5 CoreFoundation 0x357a8d50 __CFRunLoopDoObservers + 252
6 CoreFoundation 0x357a916a __CFRunLoopRun + 946
7 CoreFoundation 0x3572c49e CFRunLoopRunSpecific + 294
8 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
9 WebCore 0x37472c9c RunWebThread(void*) + 396
10 libsystem_c.dylib 0x349f572e _pthread_start + 314
11 libsystem_c.dylib 0x349f55e8 thread_start + 0
Thread 4:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 5 name: com.apple.NSURLConnectionLoader
Thread 5:
0 libsystem_kernel.dylib 0x3583c004 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3583c1fa mach_msg + 50
2 CoreFoundation 0x357aa3ec __CFRunLoopServiceMachPort + 120
3 CoreFoundation 0x357a9124 __CFRunLoopRun + 876
4 CoreFoundation 0x3572c49e CFRunLoopRunSpecific + 294
5 CoreFoundation 0x3572c366 CFRunLoopRunInMode + 98
6 Foundation 0x34b71bb2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7 Foundation 0x34b71a7a -[NSThread main] + 66
8 Foundation 0x34c0558a __NSThread__main__ + 1042
9 libsystem_c.dylib 0x349f572e _pthread_start + 314
10 libsystem_c.dylib 0x349f55e8 thread_start + 0
Thread 6:
0 libsystem_kernel.dylib 0x3584ccd4 __workq_kernreturn + 8
1 libsystem_c.dylib 0x349eff36 _pthread_wqthread + 610
2 libsystem_c.dylib 0x349efcc8 start_wqthread + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x00000000
r4: 0x00000006 r5: 0x3f0f8d98 r6: 0x00000002 r7: 0x2fee39a8
r8: 0x00000000 r9: 0x35045a4a r10: 0x0014a888 r11: 0x333f4f69
ip: 0x00000148 sp: 0x2fee399c lr: 0x34a3420f pc: 0x3584c32c
cpsr: 0x00000010
修改 崩溃只发生在iPad(越狱)5.1.1 上。使用iPad(越狱)7.0.4或6. - >它有效。*
原因: 当我调用openActiveSessionWithCompletion
函数时,我会采取许多措施来收集信息以建立网址链接。它包括动作:获取 UUIDString 。对于iOS 5.1,当get UUIDString 是一个NULL字符串时的结果。因此,当我调用命令时,应用程序崩溃的原因是:uuid_String = [[NSString alloc]initWithString:[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]];
。 initWithString:
这个函数在推送一个NULL字符串时会使app崩溃。
答案 0 :(得分:1)
这是错误的:
uuid_String = [[NSString alloc]initWithString:[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]]
这样做:
uuid_String = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
至于为什么它返回nil,可能是因为在设备上禁用了广告。允许用户退出跟踪。
检查文档并注意iOS 5和7有不同的行为。