user784625
user784625

Reputation: 1938

App With CocoaPods Distribution AdHoc Crash (uses keychain and keychain returns null)

xcode swift project runs with couple cocoapods frameworks like MQTTClient, uses keychain and keychain returns null,works well on xcode but crashes on distribution adhoc, I have done everything re installing cocoapods, adding the .a files of cocoa to build phases, adding library search path, i'm not figuring out why keychain keeps returning nil and why it keeps crashing on Distribution adhoc, here is the crash report

Class MQTTManager start function accesses the cocopods MQTTClient.a And accesses the keychain

Incident Identifier: 4B4B005E-7BC2-487D-9A8A-FEEAB4967CF4
CrashReporter Key:   TODO
Hardware Model:      iPhone7,2
Process:         testProj [494]
Path:            /private/var/mobile/Containers/Bundle/Application      /3A3B094D-FACB-49B9-BE84-5EA6F8F40D2A/testProj.app/testProj

Identifier:      com.test.testProj
Version:         205
Code Type:       ARM-64
Parent Process:  launchd [1]

Date/Time:       2015-03-13 14:28:20 +0000
OS Version:      iPhone OS 8.2 (12D508)
Report Version:  104

Exception Type:  SIGTRAP
Exception Codes: #0 at 0x1002559e4
Crashed Thread:  0

Thread 0 Crashed:
0   testProj                           0x00000001002559e4 _TFC9testProj11MQTTManager5startfS0_FT_T_ + 2000
1   testProj                           0x000000010014a134 _TFFC9testProj16SignInController9checkUserFS0_FT_T_U_FTCSo12NSURLRequestGSqCSo17NSHTTPURLResponse_GSqPSs9AnyObject__GSqCSo7NSError__T_ + 3848
2   testProj                           0x0000000100244b68 _TFFFC9testProj7Request8responseFDS0_FT5queueGSqCSo8NSObject_10serializerFTCSo12NSURLRequestGSqCSo17NSHTTPURLResponse_GSqCSo6NSData__TGSqPSs9AnyObject__GSqCSo7NSError__17completionHandlerFTS2_GSqS3__GSqPS5___GSqS6___T__DS0_U_FT_T_U_FT_T_ + 640
3   libdispatch.dylib                   0x0000000198631994 <redacted> + 24
4   libdispatch.dylib                   0x0000000198631954 <redacted> + 16
5   libdispatch.dylib                   0x000000019863620c _dispatch_main_queue_callback_4CF + 1608
6   CoreFoundation                      0x0000000186fc22ec <redacted> + 12
7   CoreFoundation                      0x0000000186fc0394 <redacted> + 1492
8   CoreFoundation                      0x0000000186eed1f4 CFRunLoopRunSpecific + 396
9   GraphicsServices                    0x000000019030f6fc GSEventRunModal + 168
10  UIKit                               0x000000018b87e10c UIApplicationMain + 1488
11  testProj                           0x00000001001c0c60 main + 116
12  libdyld.dylib                       0x000000019865ea08 <redacted> + 4

Upvotes: 0

Views: 212

Answers (1)

user784625
user784625

Reputation: 1938

Found a solution here http://dasdev.de/2014/12/04/assessing-the-keychain-in-swift/

I found that its not connected to cocoapods libraries of any searchpaths

I had to change the swift compiler optimization flags to [NONE], took me 2 days to found an answer, and thats it, it works fine

Upvotes: 0

Related Questions