Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application crashing in didFinishLaunchingWithOptions #153

Closed
tleyden opened this issue Oct 10, 2013 · 7 comments
Closed

Application crashing in didFinishLaunchingWithOptions #153

tleyden opened this issue Oct 10, 2013 · 7 comments

Comments

@tleyden
Copy link
Contributor

tleyden commented Oct 10, 2013

Here's the code that's crashing:

https://github.com/vinceyoumans/couchbaseLite-vy02-test/blob/master/cblite02/cblite02/AppDelegate.m

Nothing jumped out at me.. though I didn't try to run it.

@tleyden
Copy link
Contributor Author

tleyden commented Oct 10, 2013

Closing as duplicate of #154

@tleyden tleyden closed this as completed Oct 10, 2013
@vinceyoumans
Copy link

2013-10-10 18:53:43.273 cblite02[5527:a0b] -[FMDatabase intForQuery:]: unrecognized selector sent to instance 0xa1163b0
2013-10-10 18:53:43.277 cblite02[5527:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FMDatabase intForQuery:]: unrecognized selector sent to instance 0xa1163b0'
*** First throw call stack:
(
0 CoreFoundation 0x01a075e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x0178a8b6 objc_exception_throw + 44
2 CoreFoundation 0x01aa4903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x019f790b __forwarding
+ 1019
4 CoreFoundation 0x019f74ee _CF_forwarding_prep_0 + 14
5 cblite02 0x0000351c -[CBLDatabase(Internal) schemaVersion] + 54
6 cblite02 0x000037a2 -[CBLDatabase(Internal) open:] + 113
7 cblite02 0x0003915b -[CBLManager createDatabaseNamed:error:] + 90
8 cblite02 0x00002721 -[AppDelegate application:didFinishLaunchingWithOptions:] + 193
9 UIKit 0x004f6f65 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 309
10 UIKit 0x004f77a5 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1536
11 UIKit 0x004fbfb8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
12 UIKit 0x0051042c -[UIApplication handleEvent:withNewEvent:] + 3447
13 UIKit 0x00510999 -[UIApplication sendEvent:] + 85
14 UIKit 0x004fdc35 _UIApplicationHandleEvent + 736
15 GraphicsServices 0x03bb22eb _PurpleEventCallback + 776
16 GraphicsServices 0x03bb1df6 PurpleEventCallback + 46
17 CoreFoundation 0x01982dd5 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 53
18 CoreFoundation 0x01982b0b __CFRunLoopDoSource1 + 523
19 CoreFoundation 0x019ad7ec __CFRunLoopRun + 2156
20 CoreFoundation 0x019acb33 CFRunLoopRunSpecific + 467
21 CoreFoundation 0x019ac94b CFRunLoopRunInMode + 123
22 UIKit 0x004fb6ed -[UIApplication _run] + 840
23 UIKit 0x004fd94b UIApplicationMain + 1225
24 cblite02 0x00002b6d main + 141
25 libdyld.dylib 0x021f4725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@vinceyoumans
Copy link

the problem can be found in AppDeligate.m
I found where is crashes, and left //remarks
but this is straight out of the iOS documents. xCode 5.0

@tleyden
Copy link
Contributor Author

tleyden commented Oct 10, 2013

I found a thread in the google group that might be relevant: https://groups.google.com/forum/#!topic/mobile-couchbase/aQw-xwqqkVI - look for the post that starts with "Ugh. Thanks for letting me know" on 12/22/11. Also another thread: https://groups.google.com/forum/#!msg/mobile-couchbase/kAx27QJD4ts/kA-xdCda3B0J

@vinceyoumans
Copy link

Yea.... I am using xCode 5.
The trick is to add "-ObjC" to "Other Linked Flags"
You can find "Other Linked Flags" in Build Setting.. Linking.
I would guess that this is the same problem with xCode 4

@tleyden tleyden closed this as completed Oct 10, 2013
@tleyden
Copy link
Contributor Author

tleyden commented Oct 10, 2013

@snej should we add this to the FAQ?

@snej
Copy link
Contributor

snej commented Oct 11, 2013

It's already mentioned in the docs in the Adding Couchbase Lite To Your App section, but I agree that it doesn't exactly jump out at you. :)

Back in the day, CouchCocoa's initialization code had a check for this situation and would log a warning telling you to turn on the -ObjC flag. It would be pretty easy to add something similar to CBLManager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants