NullPointerException: Attempt to invoke virtual method 'void java.util.Calendar.setTimeZone(java.util.TimeZone)' on a null object reference


  • developer

    @chrstn-hntschl If we could only reproduce this problem… Unfortunately, we don't have an Android 8.0 device, and in the 8.0 emulator, I can't reproduce the problem.

    To dig into this, I'd really need to reproduce that.



  • I also experience said problem on Android 8.0.0 (Oneplus 3) with DAVdroid 1.11.5-gplay. The server side backend is Sabre/DAV (like with Nextcloud, Baikal, etc.), though I think that is isn't a server-side problem (by the information shown in this thread).

    @rfc2822 I can reproduce the exception arbitrarily many times by syncing events to the device that have not existed on the device before. The issue occurs specifically for full-day events (that don't even have any time zone information defined), like the one listed below. Even events I have created on my device, synced to the server and after that forced to resync to the device (by turning the calendar off and on again) face this kind of issue. Maybe this helps for reproducing/debugging the exception?

    I will also take a look at the issue tracker of ical4j and provide the same information there.

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:+//IDN bitfire.at//DAVdroid/1.11.5-gplay ical4j/2.2.0
    BEGIN:VEVENT
    DTSTAMP:20180723T194806Z
    UID:84019e86-b164-45fe-881f-c1a4ec9b70c1
    SUMMARY:#########
    LOCATION:#########
    DTSTART;VALUE=DATE:20180818
    DTEND;VALUE=DATE:20180826
    TRANSP:TRANSPARENT
    END:VEVENT
    END:VCALENDAR
    


  • @traderjoe said in NullPointerException: Attempt to invoke virtual method 'void java.util.Calendar.setTimeZone(java.util.TimeZone)' on a null object reference:

    I also experience said problem on Android 8.0.0 (Oneplus 3) with DAVdroid 1.11.5-gplay. The server side backend is Sabre/DAV (like with Nextcloud, Baikal, etc.), though I think that is isn't a server-side problem (by the information shown in this thread).

    I just tried to reinstall DAVdroid, which magically fixed the problem. Maybe the information I provided will still help in fixing the original issue.



  • I installed the latest nextcloud version (13.0.5) and this seemed to have fixed the problem for the moment, which is strange, since it used to work with 13.0.4 as well at some point...


  • developer

    This post is deleted!


  • This following is a bit of a guess, but this problem only just happened for me, whereas my update to Android 8.0.0 was a while ago - and I have thought of something else which is relevant. (That said, I have also installed some more minor updates from Samsung, fairly recently, though these haven't changed the displayed version numbers of anything, and I /think/ this was also longer ago than the problem starting...)

    Anyway, one thing I have done with my calendars recently - but haven't ever done with them before - is to change the calender of an event. Google Calendar, which I mainly use, has never allowed this: after an event is first created, you have to delete the event and re-create it in a different calendar. But the Samsung Calendar app (which looks as if it is based on Google Calendar, though I don't know for sure) /does/ allow you to change the calendar of an event. I only noticed that the Samsung Calendar had this option recently, and I only used it even more recently. Is there any chance that doing this is what triggers the issue?

    (I haven't had a chance to test this further yet, as I haven't yet had the time to reset my calendar storage to test this, as I'd want to try to figure out all my recent calendar changes since the error started popping up, so as not to lose them, first!)



  • @mjsbeaton thanks for your input on this! If you find a way to really re-produce the error we'd be very "happy". Unfortunately it is happening only very occasionally for users, and we don't think it's a special issue of calendar apps. We /think/ it may has to do with some sort of caching in Android 8.0.0. It also never has happened other than on 8.0.0 - so maybe it was an issue that is already fixed on 8.1 and some manufacturers have had the pity to start with an early build of 8.0.0 and now continue to deliver builds containing this bug.



  • Okay, on further testing, it doesn't seem to be that. I've deleted and reinstalled DAVdroid, and it's actually started working. (I initially saw a DAVdroid permissions notification pop up, and thought I was seeing a repeat of the error - but no, it's all working!) Then I've changed an event's calendar and it's still working. I should have tested further before posting - sorry. Will post again if I find anything repeatable of course. Thanks!



  • I have been sent over from here:

    https://forums.bitfire.at/topic/1832

    I have now reinstalled and the problem seems to have gone away.



  • Newbie to this forum and a novice troubleshooter.

    • DavDroid v2.0.4-ose (245) via F-droid
    • Phone: Samsung Galaxy S9 running Android v8.0.0
    • NextCloud server v13.0.1

    This referenced DavDroid error was the Internet search term that brought me to this thread. I don't know how to interpret info from the DavDroid error dump. I was seeing the problem from another client too, though. Thunderbird with Lightning Calendar add-on on my linux laptop. Thankfully the error/warning message in Thunderbird cited a HTTP return code of 415. I was able to look into the server logs for that error and find the specific(in my case it was only one) .ics entry that was causing this error. I'm not sure how others (citing ics entries above) found the offending entries but I share my experience and troubleshooting path in case someone can make use of it.

    Deleting the entry (appended below) cleared away the DavDroid error for me. This was not a new entry and I don't understand why it would all of a sudden start causing problems but then I don't actually use an Apple device but the person I'm sharing this calendar with does. So, perhaps their client modified the entry(I'm speculating based on the PRODID)? The HTTP status code of 415, "unsupported media type" might offer a clue to someone more clued in about these data formats too.

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Apple Inc.//Mac OS X 10.12.6//EN
    CALSCALE:GREGORIAN
    BEGIN:VEVENT
    TRANSP:TRANSPARENT
    DTEND;VALUE=DATE:20151108
    LAST-MODIFIED:20171031T125845Z
    UID:84b9619e-a433-44c7-bc8a-f3514903a0d0
    DTSTAMP:20171106T145050Z
    DESCRIPTION:birth year ?
    X-MOZ-GENERATION:3
    SEQUENCE:0
    CLASS:PUBLIC
    CATEGORIES:Birthday
    X-MOZ-LASTACK:20171031T125845Z
    SUMMARY:Cousin Jamee's bday!
    DTSTART;VALUE=DATE:20151107
    X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
    CREATED:20151129T173905Z
    RRULE:FREQ=YEARLY
    BEGIN:VALARM
    X-WR-ALARMUID:816B6585-D97E-4E0D-BBB3-5108CFA9B644
    UID:816B6585-D97E-4E0D-BBB3-5108CFA9B644
    TRIGGER:-PT15H
    ATTACH;VALUE=URI:Basso
    ACTION:AUDIO
    X-APPLE-DEFAULT-ALARM:TRUE
    ACKNOWLEDGED:20171031T050001Z
    END:VALARM
    BEGIN:VALARM
    X-WR-ALARMUID:CA946A68-9EAF-4A54-A077-E386E08F0F06
    UID:CA946A68-9EAF-4A54-A077-E386E08F0F06
    TRIGGER:-P1W
    ACTION:DISPLAY
    X-LIC-ERROR;X-LIC-ERRORTYPE=PROPERTY-PARSE-ERROR:Parse error in property
      name: ACKNOWLEDGED
    ACKNOWLEDGED:20171031T050001Z
    DESCRIPTION:Default Mozilla Description
    END:VALARM
    END:VEVENT
    END:VCALENDAR