couchbase / couchbase-lite-ios

Lightweight, embedded, syncable NoSQL database engine for iOS and MacOS apps.
Apache License 2.0
1.62k stars 297 forks source link

iOS, Notification Crash #392

Closed geet96 closed 10 years ago

geet96 commented 10 years ago

Hi,

While Runnning my couch base sync, the App Crashes Abruptly at 

this point of line

-[CBLDatabaseChange replicationProgress:]: unrecognized selector sent to instance 0x17651040 00:19:24.294| WARNING*\ : Exception caught in -[CBLDatabase doAsync:]:

I tried debugging the issue and it turns out It crashed at a point where couchabse sync's every time I add a new DOcument to database from my iOS native code

snej commented 10 years ago

There's no code in Couchbase Lite itself that implements or calls a method named -replicationProgress. The closest thing is the RootViewController class in the Grocery Sync sample. Is your app based on that sample? I strongly suspect your view controller is being dealloced without unregistering for the replication change notification, so the next time the notification is posted this happens.

geet96 commented 10 years ago

my project is based on your couchchat-ios example, I have used the same implementation as you ppl have,

Thank you for replying, also I notice that the "SyncManager" is a trying to call some method named doAsync: do you have any idea regarding this

thanjs in advance Regards, Geetanjali Dwiwedi

On Jul 21, 2014 10:24 PM, "Jens Alfke" notifications@github.com wrote:

There's no code in Couchbase Lite itself that implements or calls a method named -replicationProgress. The closest thing is the RootViewController class in the Grocery Sync sample. Is your app based on that sample? I strongly suspect your view controller is being dealloced without unregistering for the replication change notification, so the next time the notification is posted this happens.

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-49632973 .

snej commented 10 years ago

my project is based on your couchchat-ios example, I have used the same implementation as you ppl have

I suspect that you've made changes that introduced this bug. In CouchChat the -replicationProgress method is defined on the SyncManager; there is one instance of SyncManager that belongs to the AppDelegate and is never released, so there's no way for the SyncManager to get dealloced.

also I notice that the "SyncManager" is a trying to call some method named doAsync: do you have any idea regarding this

Yes, you must be using an old version of the CouchChat sources from before we updated it to the CBL 1.0 API.

geet96 commented 10 years ago

I thank you for all the help, but can you do me a one last favour by giving me the link wherebI can find the updated couchchst-ios example, I have tried searching but the one i have used was the only sample project I found..pleasr giv the link here

Regards, Geetanjali Dwiwedi

On Jul 22, 2014 6:39 AM, "Jens Alfke" notifications@github.com wrote:

my project is based on your couchchat-ios example, I have used the same implementation as you ppl have

I suspect that you've made changes that introduced this bug. In CouchChat the -replicationProgress method is defined on the SyncManager; there is one instance of SyncManager that belongs to the AppDelegate and is never released, so there's no way for the SyncManager to get dealloced.

also I notice that the "SyncManager" is a trying to call some method named doAsync: do you have any idea regarding this

Yes, you must be using an old version of the CouchChat sources from before we updated it to the CBL 1.0 API.

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-49686712 .

snej commented 10 years ago

https://github.com/couchbaselabs/CouchChat-iOS

It's the first hit on Google if you search for couchchat-ios; don't know how you missed it.

More samples are here.

geet96 commented 10 years ago

I haf downloaded from this same site, When did you update the library, I downloaded frm this site two weeks back ...anyways let me try updating again, thanks for the help

Regards, Geetanjali Dwiwedi

On Jul 22, 2014 12:04 PM, "Jens Alfke" notifications@github.com wrote:

https://github.com/couchbaselabs/CouchChat-iOS

It's the first hit on Google if you search for couchchat-ios; don't know how you missed it.

More samples are here http://developer.couchbase.com/mobile/develop/samples/samples/index.html .

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-49703236 .

geet96 commented 10 years ago

I updated the Library and tried, I also used the latest couchChat-ios example but still I am gettings these logs, also app keeps crashing with an LLDb error

PFA the stack trace and these are the logs

which come every now and then,

15:13:53.388| WARNING* : Exception caught in -[CBLDatabase doAsync:]:

_2014-07-24 15:13:53.479 TeamTracker[1850:90b] -[_NSCFDictionary replicationProgress:]: unrecognized selector sent to instance 0xd1c0350

15:13:53.481| WARNING* : Exception caught in -[CBLDatabase doAsync:]:

_2014-07-24 15:13:53.526 TeamTracker[1850:90b] -[_NSCFDictionary replicationProgress:]: unrecognized selector sent to instance 0xd1c0350

15:13:53.527| WARNING* : Exception caught in -[CBLDatabase doAsync:]:

Kindly look into it and revert

On Tue, Jul 22, 2014 at 12:24 PM, Geetanjali Dwivedi geet.dwd@gmail.com wrote:

I haf downloaded from this same site, When did you update the library, I downloaded frm this site two weeks back ...anyways let me try updating again, thanks for the help

Regards, Geetanjali Dwiwedi

On Jul 22, 2014 12:04 PM, "Jens Alfke" notifications@github.com wrote:

https://github.com/couchbaselabs/CouchChat-iOS

It's the first hit on Google if you search for couchchat-ios; don't know how you missed it.

More samples are here http://developer.couchbase.com/mobile/develop/samples/samples/index.html .

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-49703236 .

Regards, Geetanjali Dwiwedi

snej commented 10 years ago

Do you get these errors when you run the CouchChat example with no changes, or is it only when you run your own app?

As I said, the errors are from the SyncManager object being dealloced without removing its notification observers. The sample code never deallocs the SyncManager.

geet96 commented 10 years ago

I get this error even in CouchChat, I have only done a bit of the changes, I have removed Perdona login, and Used a direct Login Scenaario for time being I have hard-coded the credentials, and even then I keep getting the crash , Can I send you the code would you be able to cheak, and I am not de-allocating the SYnc-Manager anyWhere in the project

On Fri, Jul 25, 2014 at 12:23 AM, Jens Alfke notifications@github.com wrote:

Do you get these errors when you run the CouchChat example with no changes, or is it only when you run your own app?

As I said, the errors are from the SyncManager object being dealloced without removing its notification observers. The sample code never deallocs the SyncManager.

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-50061592 .

Regards, Geetanjali Dwiwedi

geet96 commented 9 years ago

Hi,

Just a quick Query this Couchbase lite, doesn't seems to run in

background for iOS , I do not get any replications or documents in the background, could you tell me something regarding this, I ried to push replications , but I couldn't get a single one, and when I turned

[CBLManager enableLogging: @"Sync"]; on, it says..*"going

offline"* * ChangeTracker stopped; error=(null) , *

Kindly reply

On Fri, Jul 25, 2014 at 10:41 AM, Geetanjali Dwivedi geet.dwd@gmail.com wrote:

I get this error even in CouchChat, I have only done a bit of the changes, I have removed Perdona login, and Used a direct Login Scenaario for time being I have hard-coded the credentials, and even then I keep getting the crash , Can I send you the code would you be able to cheak, and I am not de-allocating the SYnc-Manager anyWhere in the project

On Fri, Jul 25, 2014 at 12:23 AM, Jens Alfke notifications@github.com wrote:

Do you get these errors when you run the CouchChat example with no changes, or is it only when you run your own app?

As I said, the errors are from the SyncManager object being dealloced without removing its notification observers. The sample code never deallocs the SyncManager.

— Reply to this email directly or view it on GitHub https://github.com/couchbase/couchbase-lite-ios/issues/392#issuecomment-50061592 .

Regards, Geetanjali Dwiwedi

Regards, Geetanjali Dwiwedi