androidanalyticslocalytics

Cannot open session in Localytics


In my app I track some events with Localytics. The events were tracked properly, but not all events are tracked anymore the last couple of days. I set the IS_LOGGABLE to true, so I see some messages in LogCat. When I call localyticsSession.open() I see this message:

Maximum number of sessions are already on disk--not writing any new sessions until old sessions are cleared out. Try calling upload() to store more sessions.

But calling localyticsSession.upload() and then immidiately call open() again will show me the same message. When I try to call tagevent(), I'll get

Tag not written because the session was not open

At the moment I'm not able to open a session, I'm not able to clear the old sessions and I'm not able to write a tag.

For a complete cycle of open() upload() tagevent() close() I get these messages:

Maximum number of sessions are already on disk--not writing any new sessions until old sessions are cleared out. Try calling upload() to store more sessions.

SessionHandler received MESSAGE_UPLOAD

UploadHandler Received MESSAGE_UPLOAD

Handler received MESSAGE_UPLOAD_COMPLETE

Handler received MESSAGE_TAG

Tag not written because the session was not open

Session was not open, so close is not possible.


Solution

  • (Edit: Problem solved, updated with solution)

    This is happening because the uploader was not getting the data it expected out of the Sqlite database because of this bug in Android: http://code.google.com/p/android/issues/detail?id=3707

    As a result, the uploader wasn't able to upload data. This causes none of the data to be deleted so our limit on the number of stored sessions was being reached. This is why you are unable to open any further sessions.

    We updated our library last night with a fix and it is available on our download site: http://wiki.localytics.com/

    -- Henry