gggard / AndroidCaldavSyncAdapater

Caldav synch adapter for Android
246 stars 88 forks source link

Attempt to invoke virtual method ...getAndroidCalendarUri() on on a null object reference #253

Open flooose opened 8 years ago

flooose commented 8 years ago

I'm getting the following error when I run CaldavSyncAdapter on my cyanogenmod:

java.lang.NullPointerException: Attempt to invoke virtual method
'android.net.Uri org.gege.caldavsyncadapter.caldav.entities.DavCalendar.getAndroidCalendarUri()'
on a null object reference
at org.gege.caldavsyncadapter.caldav.entities.DavCalendar.createNewAndroidCalendar(DavCalendar.java:426)
at org.gege.caldavsyncadapter.caldav.entities.DavCalendar.checkAndroidCalendarList(DavCalendar.java:295)
at org.gege.caldavsyncadapter.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:158)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
u

It seems like the Result instance is never instantiated, but I can't figure out why.

When I run the application in an emulator, I have no problems. The main differences between the emulator and the real device are that the emulator is running "normal" android and the aosp calendar app, while the real device is running cyanogenmod with the closed source calendar app shipped with opengapps.

Unfortunately, I haven't been able to get the debugger to stop at or near the place where the exception occurs, so I can't tell you more. Could this have to do with the fact that this isn't a normal app? If you give me some feedback in this regard, I'd be happy to explore it some more.

daibutsunet commented 8 years ago

Maybe this helps:

https://github.com/gggard/AndroidCaldavSyncAdapater/issues/252

daibutsunet commented 8 years ago

Sorry, the above link reads ok, but points to nowhere. Couldn't find out in a rush how to place a link here which reads and works correctly, so just follow it manually ...

brianjmurrell commented 7 years ago

I too seem to be getting this now:

05-03 16:46:18.723  8088  8107 E SyncAdapter: Updating calendar exception java.lang.NullPointerException
05-03 16:46:18.723  8088  8107 E SyncAdapter: java.lang.NullPointerException: Attempt to invoke virtual method 'android.net.Uri org.gege.caldavsyncadapter.caldav.entities.DavCalendar.getAndroidCalendarUri()' on a null object reference
05-03 16:46:18.723  8088  8107 E SyncAdapter:   at org.gege.caldavsyncadapter.caldav.entities.DavCalendar.createNewAndroidCalendar(DavCalendar.java:426)
05-03 16:46:18.723  8088  8107 E SyncAdapter:   at org.gege.caldavsyncadapter.caldav.entities.DavCalendar.checkAndroidCalendarList(DavCalendar.java:295)
05-03 16:46:18.723  8088  8107 E SyncAdapter:   at org.gege.caldavsyncadapter.syncadapter.SyncAdapter.onPerformSync(SyncAdapter.java:158)
05-03 16:46:18.723  8088  8107 E SyncAdapter:   at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)

Is there still no idea why this is happening?

Personally I suspect some kind of bad/improperly-handled data in the calendar data coming from the calendar server. In this case it's owncloud. But this only happens to one user so I don't think it's a general owncloud problem but rather some data in a particular user's calendar.

brianjmurrell commented 7 years ago

Personally I suspect some kind of bad/improperly-handled data

Maybe not. :-( Even with only a single calendar, empty, I get this issue, for (only) this one user.