cloudant / CDTDatastore

Cloudant Sync iOS datastore library.
Apache License 2.0
175 stars 53 forks source link

iOS Uncaught Exception, please help ! #336

Closed yaseenox-personal closed 7 years ago

yaseenox-personal commented 7 years ago

I am facing this error and I tried a lot to debug the problem but without any success. the error happen when I press the "slider menu" button to go to the table view that use the Data Base which has a samples objects, however the table-view never appear, and I get this error message.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FMDatabase setKeyWithProvider:error:]: unrecognized selector sent to instance 0x7f8f48684800' * First throw call stack: ( 0 CoreFoundation 0x0000000104284d85 exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010388edeb objc_exception_throw + 48 2 CoreFoundation 0x000000010428dd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x00000001041d3cfa __forwarding + 970 4 CoreFoundation 0x00000001041d38a8 _CF_forwarding_prep_0 + 120 5 NewsHive 0x000000010056c2c1 49-[TD_Database openFMDBWithEncryptionKeyProvider:]_block_invoke + 113 6 NewsHive 0x00000001005bf7dc __30-[FMDatabaseQueue inDatabase:]_block_invoke + 124 7 libdispatch.dylib 0x00000001069593eb _dispatch_client_callout + 8 8 libdispatch.dylib 0x000000010693def5 _dispatch_barrier_sync_f_invoke + 393 9 NewsHive 0x00000001005bf704 -[FMDatabaseQueue inDatabase:] + 292 10 NewsHive 0x000000010056bff7 -[TD_Database openFMDBWithEncryptionKeyProvider:] + 439 11 NewsHive 0x000000010056cb61 -[TD_Database openWithEncryptionKeyProvider:] + 241 12 NewsHive 0x000000010054315d -[CDTDatastore initWithManager:database:encryptionKeyProvider:] + 605 13 NewsHive 0x000000010054cd08 -[CDTDatastoreManager datastoreNamed:withEncryptionKeyProvider:error:] + 264 14 NewsHive 0x000000010054cbba -[CDTDatastoreManager datastoreNamed:error:] + 122 15 NewsHive 0x000000010051d99b _TFC8NewsHive10ArticlesVC13initDatastorefTT + 1771 16 NewsHive 0x000000010051c71c _TFC8NewsHive10ArticlesVC11viewDidLoadfTT + 780 17 NewsHive 0x000000010051c752 _TToFC8NewsHive10ArticlesVC11viewDidLoadfTT + 34 18 UIKit 0x0000000100ec8984 -[UIViewController loadViewIfRequired] + 1198 19 UIKit 0x0000000100f0cfae -[UINavigationController _layoutViewController:] + 54 20 UIKit 0x0000000100f0d882 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 462 21 UIKit 0x0000000100f0d9f4 -[UINavigationController _startTransition:fromViewController:toViewController:] + 126 22 UIKit 0x0000000100f0ec4d -[UINavigationController _startDeferredTransitionIfNeeded:] + 890 23 UIKit 0x0000000100f0fd0b -[UINavigationController viewWillLayoutSubviews] + 57 24 UIKit 0x00000001010be503 -[UILayoutContainerView layoutSubviews] + 248 25 UIKit 0x0000000100de8980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703 26 QuartzCore 0x00000001034acc00 -[CALayer layoutSublayers] + 146 27 QuartzCore 0x00000001034a108e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366 28 QuartzCore 0x00000001034a0f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 29 QuartzCore 0x00000001034953c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 30 QuartzCore 0x00000001034c3086 _ZN2CA11Transaction6commitEv + 486 31 UIKit 0x0000000100d5a19b _afterCACommitHandler + 174 32 CoreFoundation 0x00000001041a9c37 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 33 CoreFoundation 0x00000001041a9ba7 CFRunLoopDoObservers + 391 34 CoreFoundation 0x000000010419f7fb CFRunLoopRun + 1147 35 CoreFoundation 0x000000010419f0f8 CFRunLoopRunSpecific + 488 36 GraphicsServices 0x00000001052edad2 GSEventRunModal + 161 37 UIKit 0x0000000100d2df09 UIApplicationMain + 171 38 NewsHive 0x000000010052f7d2 main + 114 39 libdyld.dylib 0x000000010698e92d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

rhyshort commented 7 years ago

What version of the library are you using? How did you get this exception? Were you using the sample app or your own application? Do you have any code that reproduces the issue that you can share with us?

yaseenox-personal commented 7 years ago

Hi, I am using version 1.0.0 (pod "CDTDatastore", '~> 1.0.0'). I implemented the database into my own application it's a news application under development. I put a snippets which trigger the error in the attachment file. Thank you. cloudant.txt

rhyshort commented 7 years ago

Do you get the problem with 1.1.1?

yaseenox-personal commented 7 years ago

I update to 1.1.1, and I got this error: -[FMDatabase setKeyWithProvider:error:]: unrecognized selector sent to instance 0x156fa220 I attached an image for the error. screen shot 2016-10-31 at 3 42 12 pm

rhyshort commented 7 years ago

I haven't managed to reproduce this on my end, on iOS 10.1, with Swift 3.0.1. Is there a specific combination that forces this error out? Are you using the latest CocoaPods incase there is a issue there?

yaseenox-personal commented 7 years ago

Swift version 2.2, iOS 9.3.3, CocoaPods version 1.0.1

rhyshort commented 7 years ago

Using the iOS 9 simulator and CocoaPods 1.0.1, I still haven't been able to reproduce. Is it possible for you to send a small sample project which always causes this error to occur?

yaseenox-personal commented 7 years ago

Here is the project. you can run it and when you press the articles button from the menu the error occur. NewsHive.zip

rhyshort commented 7 years ago

Your project set up is incorrect, you need to add $(inherited) to OTHER_LDFLAGS, and your app will work fine.

yaseenox-personal commented 7 years ago

I cant thank you enough really.

rhyshort commented 7 years ago

Not a problem 😄