AndroidCaldavSyncAdapater icon indicating copy to clipboard operation
AndroidCaldavSyncAdapater copied to clipboard

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

Open flooose opened this issue 8 years ago • 4 comments

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.

flooose avatar May 26 '16 05:05 flooose

Maybe this helps:

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

daibutsunet avatar Jun 07 '16 10:06 daibutsunet

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 ...

daibutsunet avatar Jun 07 '16 10:06 daibutsunet

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 avatar May 03 '17 20:05 brianjmurrell

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.

brianjmurrell avatar May 03 '17 21:05 brianjmurrell