登录facebook时,IOS Swift App崩溃

时间:2015-12-17 04:22:19

标签: ios swift facebook-graph-api crash facebook-sdk-4.x

我的iOS应用程序被Apple审核小组拒绝了。他们在登录时报告应用程序崩溃。当我在自己的设备上进行测试时,一切正常。

  

完整崩溃日志

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000100138fe8
Triggered by Thread:  0

Filtered syslog:
None found

Global Trace Buffer (reverse chronological seconds):
8.902161     CFNetwork                  0x0000000183111a18 TCP Conn 0x15fe913a0 SSL Handshake DONE
8.922797     CFNetwork                  0x0000000183111928 TCP Conn 0x15fe913a0 starting SSL negotiation
8.923048     CFNetwork                  0x00000001831b3a30 TCP Conn 0x15fe913a0 complete. fd: 6, err: 0
8.924045     CFNetwork                  0x00000001831b4f5c TCP Conn 0x15fe913a0 event 1. err: 0
14.702718    AppleJPEG                  0x000000018aceeb64 [0x1601cba00] Releasing session
14.765290    AppleJPEG                  0x000000018acee348 [0x1601cba00] Created session
18.109961    CFNetwork                  0x00000001831b3a30 TCP Conn 0x1618cbc30 complete. fd: 6, err: 0
18.110646    CFNetwork                  0x00000001831b4f5c TCP Conn 0x1618cbc30 event 1. err: 0
18.317944    CFNetwork                  0x00000001831b5034 TCP Conn 0x1618cbc30 started



Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   CC DOUBLE O                     0x0000000100138fe8 LoginViewController.(returnUserData(LoginViewController) -> () -> ()).(closure #1) (LoginViewController.swift:228)
1   FBSDKCoreKit                    0x00000001006f68a8 0x1006d0000 + 157864
2   FBSDKCoreKit                    0x00000001006f4594 0x1006d0000 + 148884
3   FBSDKCoreKit                    0x00000001006f4364 0x1006d0000 + 148324
4   FBSDKCoreKit                    0x00000001006f3e18 0x1006d0000 + 146968
5   CoreFoundation                  0x0000000183907990 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 132
6   CoreFoundation                  0x0000000183907800 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 172
7   FBSDKCoreKit                    0x00000001006f3bd4 0x1006d0000 + 146388
8   FBSDKCoreKit                    0x00000001006f30d4 0x1006d0000 + 143572
9   FBSDKCoreKit                    0x00000001006f12a8 0x1006d0000 + 135848
10  FBSDKCoreKit                    0x000000010070a0dc 0x1006d0000 + 237788
11  FBSDKCoreKit                    0x000000010070a034 0x1006d0000 + 237620
12  FBSDKCoreKit                    0x000000010070a4ac 0x1006d0000 + 238764
13  CFNetwork                       0x00000001832a36a8 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 80
14  CFNetwork                       0x00000001832a3638 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 200
15  CFNetwork                       0x00000001832a37ac -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 56
16  CFNetwork                       0x000000018310f4fc ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 100
17  CFNetwork                       0x00000001831fdb38 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 108
18  libdispatch.dylib               0x00000001990756a8 _dispatch_client_callout + 16
19  libdispatch.dylib               0x000000019907e9e4 _dispatch_block_invoke + 540
20  CFNetwork                       0x00000001830fbce4 RunloopBlockContext::_invoke_block(void const*, void*) + 36
21  CoreFoundation                  0x00000001838f46cc CFArrayApplyFunction + 68
22  CFNetwork                       0x00000001830fbbc8 RunloopBlockContext::perform() + 136
23  CFNetwork                       0x00000001830fba88 MultiplexerSource::perform() + 312
24  CFNetwork                       0x00000001830fb8b4 MultiplexerSource::_perform(void*) + 68
25  CoreFoundation                  0x00000001839c8544 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
26  CoreFoundation                  0x00000001839c7fd8 __CFRunLoopDoSources0 + 540
27  CoreFoundation                  0x00000001839c5cd8 __CFRunLoopRun + 724
28  CoreFoundation                  0x00000001838f4ca0 CFRunLoopRunSpecific + 384
29  GraphicsServices                0x000000018e988088 GSEventRunModal + 180
30  UIKit                           0x000000018900cffc UIApplicationMain + 204
31  CC DOUBLE O                     0x0000000100100940 main (AppDelegate.swift:19)
32  libdyld.dylib                   0x00000001990a68b8 start + 4

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x00000001991c44fc kevent_qos + 8
1   libdispatch.dylib               0x0000000199088a04 _dispatch_mgr_invoke + 232
2   libdispatch.dylib               0x0000000199077874 _dispatch_source_invoke + 0

Thread 2:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 3 name:  com.twitter.crashlytics.ios.MachExceptionServer
Thread 3:
0   libsystem_kernel.dylib          0x00000001991aa598 write + 8
1   CC DOUBLE O                     0x000000010019f08c CLSSDKFileLog + 444
2   CC DOUBLE O                     0x000000010018e810 CLSMachExceptionServer + 180
3   libsystem_pthread.dylib         0x000000019928bb28 _pthread_body + 156
4   libsystem_pthread.dylib         0x000000019928ba8c _pthread_body + 0
5   libsystem_pthread.dylib         0x0000000199289028 thread_start + 4

Thread 4 name:  com.apple.NSURLConnectionLoader
Thread 4:
0   libsystem_kernel.dylib          0x00000001991a8a40 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001991a88bc mach_msg + 72
2   CoreFoundation                  0x00000001839c8108 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001839c5e0c __CFRunLoopRun + 1032
4   CoreFoundation                  0x00000001838f4ca0 CFRunLoopRunSpecific + 384
5   CFNetwork                       0x000000018318db84 +[NSURLConnection(Loader) _resourceLoadLoop:] + 412
6   Foundation                      0x0000000184953c80 __NSThread__start__ + 1000
7   libsystem_pthread.dylib         0x000000019928bb28 _pthread_body + 156
8   libsystem_pthread.dylib         0x000000019928ba8c _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000199289028 thread_start + 4

Thread 5 name:  GAIThread
Thread 5:
0   libsystem_kernel.dylib          0x00000001991a8a40 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x00000001991a88bc mach_msg + 72
2   CoreFoundation                  0x00000001839c8108 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001839c5e0c __CFRunLoopRun + 1032
4   CoreFoundation                  0x00000001838f4ca0 CFRunLoopRunSpecific + 384
5   Foundation                      0x000000018486d2bc -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 308
6   Foundation                      0x00000001848c28f4 -[NSRunLoop(NSRunLoop) run] + 88
7   CC DOUBLE O                     0x000000010016d45c +[GAI threadMain:] + 72
8   Foundation                      0x0000000184953c80 __NSThread__start__ + 1000
9   libsystem_pthread.dylib         0x000000019928bb28 _pthread_body + 156
10  libsystem_pthread.dylib         0x000000019928ba8c _pthread_body + 0
11  libsystem_pthread.dylib         0x0000000199289028 thread_start + 4

Thread 6 name:  com.apple.CFSocket.private
Thread 6:
0   libsystem_kernel.dylib          0x00000001991c3368 __select + 8
1   CoreFoundation                  0x00000001839ce670 __CFSocketManager + 648
2   libsystem_pthread.dylib         0x000000019928bb28 _pthread_body + 156
3   libsystem_pthread.dylib         0x000000019928ba8c _pthread_body + 0
4   libsystem_pthread.dylib         0x0000000199289028 thread_start + 4

Thread 7:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 8:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 9:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 10:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 11:
0   libsystem_kernel.dylib          0x00000001991c3b6c __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000199289530 _pthread_wqthread + 1284
2   libsystem_pthread.dylib         0x0000000199289020 start_wqthread + 4

Thread 12:

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x00000001618a1441   x1: 0x40000000000000e6   x2: 0x00000001618a1430   x3: 0x0000000000000000
    x4: 0x0000000000000007   x5: 0x0000000000000010   x6: 0x0000000000000001   x7: 0x0000000000000000
    x8: 0x0000000ffffffff8   x9: 0x00000000000003b8  x10: 0x000000015ff323a8  x11: 0x0000000000000001
   x12: 0x00000001600b8e10  x13: 0x000001a19fa8fac1  x14: 0x00000000ffffffff  x15: 0x00000000fffffffd
   x16: 0x0000000189976aa1  x17: 0x0000000183913e34  x18: 0x0000000000000000  x19: 0x400000000000000f
   x20: 0x0000000161872480  x21: 0x0000000000000000  x22: 0x000000015ff31ff0  x23: 0x0000000161872480
   x24: 0x00000001618a1441  x25: 0x0000000161865c40  x26: 0x000000015fef7fb0  x27: 0x00000001618a1430
   x28: 0x000000010139e3b0  fp: 0x000000016fd36080   lr: 0x0000000100138e38
    sp: 0x000000016fd35f80   pc: 0x0000000100138fe8 cpsr: 0x60000000
  

第228行是self.login(“fb”,id:self.dict.valueForKey(“id”)as!   字符串,访问:FBSDKAccessToken.currentAccessToken()。tokenCtring)

    func returnUserData()
    {
        if((FBSDKAccessToken.currentAccessToken()) != nil){
            FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, first_name, last_name, email"]).startWithCompletionHandler({ (connection, result, error) -> Void in
                if (error == nil){
                    self.dict = result as! NSDictionary
                    print(self.dict)
//                    print(self.dict.objectForKey("email") as! String)
           (line 228) self.login("fb", id: self.dict.valueForKey("id") as! String, access: FBSDKAccessToken.currentAccessToken().tokenString)
                }
            })
        }
    }

func login(type:String,id:String,access:String){
    self.apiService.requestLogin(type ,id: id, access: access, deviceToken: self.deviceToken, completionHandler: { (obj, success) -> Void in

        self.handlerLoginResponse(obj!)

    })

}


func handlerLoginResponse(obj:AnyObject){
    let json = JSON(obj)
    let status = json["status"].intValue
    let errmessage = json["error"]["message"].stringValue

    switch status {
    case 1:
        let userId = json["data"]["id"].stringValue
        let userToken = json["data"]["token"].stringValue
        self.defaults.setObject(userId, forKey: UserDefaultsContracts.KEY_USER_ID)
        self.defaults.setObject(userToken, forKey: UserDefaultsContracts.KEY_TOKEN)
        self.defaults.synchronize()
        self.performSegueWithIdentifier("ToRootView", sender: nil)
    case -5:
        print(errmessage)
        self.performSegueWithIdentifier("CreateAccountViewController", sender: nil)
    default:
        print(errmessage)
    }
}

0 个答案:

没有答案