Without linking framework, application compiles, runs on iOS 8 simulator and iOS 7 device, but crashes on iOS 8 device
I was programming an iPhone application that requires accessing user’s contacts.
I used APAddressBook library
###The application complies; it works on my old iPhone 4 that runs iOS 7.1; works on simulator; but not on my iPhone 6 (iOS 8.1.2).
###The weird thing was, the application crashes right before the contacts view controller shows up; no error messages; setting breakpoints won’t work; only prints this message:
As I said, setting breakpoints won’t work; the application just quits with no useful information provided, so I couldn’t debug.
I tried:
-
Write the view controller in Objective-C, rather than Swift
-
Changed code signing from distribution to developer
Along with:
-
Constantly cleaning;
-
Constantly cleaning build folder
Wouldn’t work.
##At the end, I realized that the problem was, I didn’t link ‘AddressBook.framework’.
So I went to target settings; added ‘AddressBook.framework’ to ‘Linked Frameworks and Libraries’; cleaned project and cleaned build folder.
Ran the application on my device; the application still crashes, but it won’t just disappear without any useful information. I got information about the error.
That’s great. Although it still crashes, but at least I’m able to debug.