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



  • @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
    


  • I also experience the error (still do today, quite annoying), and I noticed it is typically connected to one specific entry in my calendar. It is never a full-day event, but always one that has from: and to: times. Simply recreating the same event recreates the problem, but changing it to an all-day event stops the error from appearing. Still, I don’t find that is really a solution.

    Galaxy A3 2017
    Android 8.0.0
    DAV x5 version 2.2.1-gplay (262)

    --- BEGIN DEBUG INFO ---
    Account name: xxxxxxxx@posteo.net
    Authority: com.android.calendar
    
    EXCEPTION:
    java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Calendar.setTimeZone(java.util.TimeZone)' on a null object reference
    	at java.text.DateFormat.setTimeZone(DateFormat.java:690)
    	at net.fortuna.ical4j.model.Iso8601.<init>(Iso8601.java:77)
    	at net.fortuna.ical4j.model.Date.<init>(Date.java:150)
    	at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:262)
    	at net.fortuna.ical4j.util.Dates.getInstance(Dates.java:223)
    	at net.fortuna.ical4j.model.Recur.getDates(Recur.java:600)
    	at net.fortuna.ical4j.model.Recur.getDates(Recur.java:520)
    	at net.fortuna.ical4j.model.component.Observance.getLatestOnset(Observance.java:231)
    	at net.fortuna.ical4j.model.TimeZone.getRawOffset(TimeZone.java:180)
    	at net.fortuna.ical4j.model.TimeZone.<init>(TimeZone.java:69)
    	at net.fortuna.ical4j.data.CalendarBuilder$ContentHandlerImpl.endComponent(CalendarBuilder.java:245)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:444)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:406)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:208)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:115)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:180)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:149)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:198)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:178)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:165)
    	at net.fortuna.ical4j.model.TimeZoneLoader.loadVTimeZone(TimeZoneLoader.java:108)
    	at net.fortuna.ical4j.model.TimeZoneRegistryImpl.getTimeZone(TimeZoneRegistryImpl.java:181)
    	at at.bitfire.ical4android.AndroidEvent.populateEvent(AndroidEvent.kt:172)
    	at at.bitfire.davdroid.resource.LocalEvent.populateEvent(LocalEvent.kt:56)
    	at at.bitfire.ical4android.AndroidEvent.getEvent(AndroidEvent.kt:107)
    	at at.bitfire.davdroid.resource.LocalCalendar.findDirty(LocalCalendar.kt:116)
    	at at.bitfire.davdroid.syncadapter.SyncManager.uploadDirty(SyncManager.kt:299)
    	at at.bitfire.davdroid.syncadapter.SyncManager$performSync$1.invoke(SyncManager.kt:122)
    	at at.bitfire.davdroid.syncadapter.SyncManager$performSync$1.invoke(SyncManager.kt:55)
    	at at.bitfire.davdroid.syncadapter.SyncManager.unwrapExceptions(SyncManager.kt:813)
    	at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.kt:108)
    	at at.bitfire.davdroid.syncadapter.CalendarsSyncAdapterService$CalendarsSyncAdapter.sync(CalendarsSyncAdapterService.kt:55)
    	at at.bitfire.davdroid.syncadapter.SyncAdapterService$SyncAdapter.onPerformSync(SyncAdapterService.kt:86)
    	at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:272)
    
    SOFTWARE INFORMATION
    * at.bitfire.davdroid 2.2.1-gplay (262) from com.android.vending
    * org.dmfs.tasks 1.1.13 (6880) from com.android.vending
    * com.android.providers.contacts 2.0.44 (204400000)
    * com.android.providers.calendar 1.0.00.35 (100000035)
    * com.samsung.android.contacts 3.8.20.9 (382000009)
    * com.samsung.android.calendar 4.4.04.7 (440400007) from com.sec.android.app.samsungapps
    
    CONNECTIVITY (at the moment)
    Active connection: WiFi, CONNECTED
    
    CONFIGURATION
    Power saving disabled: yes
    android.permission.READ_CONTACTS permission: granted
    android.permission.WRITE_CONTACTS permission: granted
    android.permission.READ_CALENDAR permission: granted
    android.permission.WRITE_CALENDAR permission: granted
    org.dmfs.permission.READ_TASKS permission: granted
    org.dmfs.permission.WRITE_TASKS permission: granted
    System-wide synchronization: automatically
    Account: xxxxxxxx@posteo.net
    Address book sync. interval: 240 min
    Calendar sync. interval: 240 min
    OpenTasks sync. interval: 240 min
    WiFi only: false
    [CardDAV] Contact group method: CATEGORIES
    [CalDAV] Time range (past days): 90
    Manage calendar colors: true
    Address book account: default addressbook (xxxxxxxx@posteo.net 3Q)
    Main account: Account {name=xxxxxxxx@posteo.net, type=bitfire.at.davdroid}
    URL: https://posteo.de:8443/addressbooks/xxxxxxxx/default/
    Sync automatically: true
    
    SQLITE DUMP
    android_metadata
    	| locale |
    	| en_GB |
    ----------
    services
    	| _id | accountName | service | principal |
    	| 1 | xxxxxxxx@posteo.net | carddav | https://posteo.de:8443/principals/xxxxxxxx/ |
    	| 2 | xxxxxxxx@posteo.net | caldav | https://posteo.de:8443/principals/xxxxxxxx/ |
    ----------
    sqlite_sequence
    	| name | seq |
    	| services | 2 |
    	| homesets | 3 |
    	| collections | 3 |
    ----------
    homesets
    	| _id | serviceID | url |
    	| 2 | 2 | https://posteo.de:8443/calendars/xxxxxxxx/ |
    	| 3 | 1 | https://posteo.de:8443/addressbooks/xxxxxxxx/ |
    ----------
    collections
    	| _id | serviceID | type | url | readOnly | forceReadOnly | displayName | description | color | timezone | supportsVEVENT | supportsVTODO | source | sync | privWriteContent | privUnbind |
    	| 2 | 2 | CALENDAR | https://posteo.de:8443/calendars/xxxxxxxx/default/ | 0 | 0 | Standardkalender | <null> | <null> | <null> | 1 | 1 | <null> | 1 | 1 | 1 |
    	| 3 | 1 | ADDRESS_BOOK | https://posteo.de:8443/addressbooks/xxxxxxxx/default/ | 0 | 0 | default addressbook | <null> | <null> | <null> | 0 | 0 | <null> | 1 | 1 | 1 |
    ----------
    
    SYSTEM INFORMATION
    Android version: 8.0.0 (R16NW.A320FLXXU3CRH2)
    Device: samsung SM-A320FL (a3y17lte)
    
    --- END DEBUG INFO ---
    
    


  • As already said, we don’t think it is related to DAVx⁵ itself. But reinstalling the app may clear some caches or the calendar storage which is somehow the cause of the problem. Full-day-events don’t have a timezone.


  • developer



  • I’m able to 100% reproduce this bug, reinstalling the app won’t help though. The problem is that Davdroid is unable to set the TZ that Evolution sets for a CalDAV entry. Here’s the error message I receive :

    java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.Calendar.setTimeZone(java.util.TimeZone)' on a null object reference
    	at java.text.DateFormat.setTimeZone(DateFormat.java:690)
    	at net.fortuna.ical4j.model.Iso8601.<init>(Iso8601.java:77)
    	at net.fortuna.ical4j.model.Date.<init>(Date.java:150)
    	at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:262)
    	at net.fortuna.ical4j.util.Dates.getInstance(Dates.java:223)
    	at net.fortuna.ical4j.model.component.Observance.getLatestOnset(Observance.java:230)
    	at net.fortuna.ical4j.model.TimeZone.getRawOffset(TimeZone.java:180)
    	at net.fortuna.ical4j.model.TimeZone.<init>(TimeZone.java:69)
    	at net.fortuna.ical4j.data.CalendarBuilder$ContentHandlerImpl.endComponent(CalendarBuilder.java:245)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:444)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:406)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:208)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:115)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:180)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:149)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:198)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:178)
    	at at.bitfire.ical4android.Event$Companion.fromReader(Event.kt:78)
    	at at.bitfire.ical4android.Event$Companion.fromReader$default(Event.kt:72)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.processVEvent(CalendarSyncManager.kt:159)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.access$processVEvent(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1$1.invoke(CalendarSyncManager.kt:144)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1$1.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:798)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1.invoke(CalendarSyncManager.kt:131)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.dav4android.Response$Companion.parse(Response.kt:211)
    	at at.bitfire.dav4android.DavResource$processMultiStatus$2.invoke(DavResource.kt:465)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:484)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:435)
    	at at.bitfire.dav4android.DavCalendar.multiget(DavCalendar.kt:151)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2.invoke(CalendarSyncManager.kt:130)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:787)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemoteCollection(SyncManager.kt:808)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.downloadRemote(CalendarSyncManager.kt:129)
    	at at.bitfire.davdroid.syncadapter.SyncManager$syncRemote$1$1.run(SyncManager.kt:447)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    

    and this is the entry that causes this:

    BEGIN:VCALENDAR
    CALSCALE:GREGORIAN
    PRODID:-//Ximian//NONSGML Evolution Calendar//EN
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:/freeassociation.sourceforge.net/Europe/Berlin
    X-LIC-LOCATION:Europe/Berlin
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19160429T230000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19160430T220000Z;BYDAY=-1SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19161007T010000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19160930T230000Z;BYDAY=1SU;BYMONTH=10
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19170416T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19180415T010000Z;BYDAY=3MO;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19170917T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19180916T010000Z;BYDAY=3MO;BYMONTH=9
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19400402T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19400401T010000Z;BYDAY=1MO;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19421105T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19421102T010000Z;BYDAY=1MO;BYMONTH=11
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19430326T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19430329T010000Z;BYDAY=-1MO;BYMONTH=3
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19431001T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19441002T010000Z;BYDAY=1MO;BYMONTH=10
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19440402T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19450402T000000Z;BYDAY=1MO;BYMONTH=4
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZNAME:CEMT
    DTSTART:19450524T020000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0300
    RRULE:FREQ=YEARLY;UNTIL=19450523T230000Z;BYDAY=-2TH;BYMONTH=5
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19450924T030000
    TZOFFSETFROM:+0300
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19450924T020000Z;BYDAY=-1MO;BYMONTH=9
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19451118T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19451118T020000Z;BYDAY=3SU;BYMONTH=11
    END:STANDARD
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19460102T000000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19451231T220000Z;BYDAY=1TU;BYMONTH=1
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19460408T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19460414T010000Z;BYDAY=2SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19461001T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19461007T010000Z;BYDAY=1MO;BYMONTH=10
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19470401T030000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19470406T010000Z;BYDAY=1SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZNAME:CEMT
    DTSTART:19470513T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0300
    RRULE:FREQ=YEARLY;UNTIL=19470511T000000Z;BYDAY=2SU;BYMONTH=5
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19470624T030000
    TZOFFSETFROM:+0300
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19470629T020000Z;BYDAY=-1SU;BYMONTH=6
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19471007T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19491002T020000Z;BYDAY=1SU;BYMONTH=10
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19480415T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19480418T010000Z;BYDAY=3SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19490408T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19490410T010000Z;BYDAY=2SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19800102T000000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19791231T220000Z;BYDAY=1TU;BYMONTH=1
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19800401T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;UNTIL=19800406T010000Z;BYDAY=1SU;BYMONTH=4
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19800930T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;UNTIL=19950924T010000Z;BYDAY=-1SU;BYMONTH=9
    END:STANDARD
    BEGIN:DAYLIGHT
    TZNAME:CEST
    DTSTART:19810325T020000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
    END:DAYLIGHT
    BEGIN:STANDARD
    TZNAME:CET
    DTSTART:19961028T030000
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
    END:STANDARD
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:29499b32bcbfd6e8d587877903d31f8b4197ef37
    DTSTAMP:20180507T042915Z
    DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Berlin:
     20181112T173000
    DTEND;TZID=/freeassociation.sourceforge.net/Europe/Berlin:
     20181112T190000
    SEQUENCE:2
    SUMMARY:St. Martinsfest
    LOCATION:Kita Buntspecht
    TRANSP:OPAQUE
    CLASS:PUBLIC
    CREATED:20180507T052305Z
    LAST-MODIFIED:20180507T052305Z
    BEGIN:VALARM
    X-EVOLUTION-ALARM-UID:ca54afeb78f18a27d0334eb25167ccec92e77f6f
    ACTION:DISPLAY
    TRIGGER;RELATED=START:-PT5M
    END:VALARM
    END:VEVENT
    END:VCALENDAR
    

    The problematic line(s) are the ones with

    TZID=/freeassociation.sourceforge.net/Europe/Berlin:
    

    Changing this to a known TZ solves the problematic sync. This problem is new to my installations but 100% reproducible on different devices. Nextcloud Calendar, K-Mail or Evolution don’t have problems with this entries, only Davdroid on my two Android 8.0 devices.


  • developer

    @A-2017-U1 Which Android 8.0 device? Can you please provide the debug info? I can try once again in Android 8 emulator, but I guess I won’t be able to reproduce the problem (like always).



  • Same error, here is what happend:

    1. Object was synced with a VTIMEZONE component but without DAYLIGHT and STANDARD information
    2. Object was changed / fixed and DAYLIGHT and STANDARD information was added
    3. Synctokens on the server were updated
    4. Resync in DAVx5 did not update the calendar entries
    5. Deselecting & selecting forced a complete resync
    6. Now the Exception was thrown
    7. Reinstall DAVx5
    8. Problem solved, exception gone

    Object

    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//Sabre//Sabre VObject 4.1.2//EN
    CALSCALE:GREGORIAN
    BEGIN:VTIMEZONE
    TZID:Europe/Vienna
    BEGIN:STANDARD
    TZOFFSETFROM:+0200
    RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
    DTSTART:19961027T030000
    TZNAME:MEZ
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0100
    RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
    DTSTART:19810329T020000
    TZNAME:MESZ
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20190110T163429Z
    UID:09941944-08d5-4f7b-8c22-4022d35b5b72.1544062802066
    SUMMARY: Foo
    DESCRIPTION:
    LOCATION:
    URL;VALUE=URI:
    DTSTART;TZID=Europe/Vienna:20190307T140000
    DTEND;TZID=Europe/Vienna:20190307T180000
    END:VEVENT
    END:VCALENDAR
    
    EXCEPTION:
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.TimeZone java.util.Calendar.getTimeZone()' on a null object reference
    	at java.text.DateFormat.getTimeZone(DateFormat.java:704)
    	at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:236)
    	at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:244)
    	at net.fortuna.ical4j.model.component.Observance.calculateOnset(Observance.java:323)
    	at net.fortuna.ical4j.model.component.Observance.calculateOnset(Observance.java:309)
    	at net.fortuna.ical4j.model.component.Observance.getLatestOnset(Observance.java:161)
    	at net.fortuna.ical4j.model.component.VTimeZone.getApplicableObservance(VTimeZone.java:252)
    	at net.fortuna.ical4j.model.TimeZone.inDaylightTime(TimeZone.java:137)
    	at java.util.TimeZone.getOffsets(TimeZone.java:246)
    	at java.util.GregorianCalendar.adjustForZoneAndDaylightSavingsTime(GregorianCalendar.java:2916)
    	at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2807)
    	at java.util.Calendar.updateTime(Calendar.java:3397)
    	at java.util.Calendar.getTimeInMillis(Calendar.java:1761)
    	at java.util.Calendar.getTime(Calendar.java:1734)
    	at java.text.SimpleDateFormat.parseInternal(SimpleDateFormat.java:1633)
    	at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1528)
    	at java.text.DateFormat.parse(DateFormat.java:360)
    	at net.fortuna.ical4j.model.DateTime.setTime(DateTime.java:415)
    	at net.fortuna.ical4j.model.DateTime.<init>(DateTime.java:321)
    	at net.fortuna.ical4j.model.property.DateProperty.setValue(DateProperty.java:137)
    	at net.fortuna.ical4j.data.CalendarBuilder$ContentHandlerImpl.propertyValue(CalendarBuilder.java:299)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.parse(CalendarParserImpl.java:282)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyParser.access$1100(CalendarParserImpl.java:229)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:210)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.parse(CalendarParserImpl.java:422)
    	at net.fortuna.ical4j.data.CalendarParserImpl$ComponentParser.access$900(CalendarParserImpl.java:406)
    	at net.fortuna.ical4j.data.CalendarParserImpl$PropertyListParser.parse(CalendarParserImpl.java:208)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendar(CalendarParserImpl.java:115)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parseCalendarList(CalendarParserImpl.java:180)
    	at net.fortuna.ical4j.data.CalendarParserImpl.parse(CalendarParserImpl.java:149)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:198)
    	at net.fortuna.ical4j.data.CalendarBuilder.build(CalendarBuilder.java:178)
    	at at.bitfire.ical4android.Event$Companion.fromReader(Event.kt:78)
    	at at.bitfire.ical4android.Event$Companion.fromReader$default(Event.kt:72)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.processVEvent(CalendarSyncManager.kt:159)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.access$processVEvent(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1$1.invoke(CalendarSyncManager.kt:144)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1$1.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:798)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1.invoke(CalendarSyncManager.kt:131)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2$1.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.dav4android.Response$Companion.parse(Response.kt:211)
    	at at.bitfire.dav4android.DavResource$processMultiStatus$2.invoke(DavResource.kt:465)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:484)
    	at at.bitfire.dav4android.DavResource.processMultiStatus(DavResource.kt:435)
    	at at.bitfire.dav4android.DavCalendar.multiget(DavCalendar.kt:151)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2.invoke(CalendarSyncManager.kt:130)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager$downloadRemote$2.invoke(CalendarSyncManager.kt:41)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemote(SyncManager.kt:787)
    	at at.bitfire.davdroid.syncadapter.SyncManager.useRemoteCollection(SyncManager.kt:808)
    	at at.bitfire.davdroid.syncadapter.CalendarSyncManager.downloadRemote(CalendarSyncManager.kt:129)
    	at at.bitfire.davdroid.syncadapter.SyncManager$syncRemote$1$1.run(SyncManager.kt:447)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    	at java.lang.Thread.run(Thread.java:764)
    
    SOFTWARE INFORMATION
    * at.bitfire.davdroid 2.2.1-ose (262) from com.google.android.packageinstaller
    * com.samsung.android.providers.contacts 2.0.49 (204900100)
    * com.android.providers.calendar 1.0.00.35 (100000035)
    * com.samsung.android.contacts 3.8.25.15 (382500015)
    * com.google.android.contacts 3.3.3.226019458 (2171200) from com.android.vending
    * com.samsung.android.calendar 4.4.04.7 (440400007) from com.sec.android.app.samsungapps
    * com.google.android.calendar 6.0.12-224984167-release (2016050925) from com.android.vending
    
    CONNECTIVITY (at the moment)
    Active connection: WiFi, CONNECTED
    


  • I’ve been getting this error myself using a galaxy S7 edge on Android 8.

    However, this error only shows if I try to sync past events. If I set “Past event time limit” to zero, there are no errors.

    I do kinda want to see past events on my phone though…


  • developer

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

    However, this error only shows if I try to sync past events. If I set “Past event time limit” to zero, there are no errors.

    Probably because then there are no events to synchronize at the moment. As soon as there are new events, it will fail again.

    I do kinda want to see past events on my phone though…

    As far as I know you will have to reinstall DAVx⁵ to get it working, like the others…



  • I did have future events that did sync at the time.

    I reinstalled and it did fix itself.


  • developer

    @Ryonez Thanks for the update!



  • I just ran into this problem as well. No recent updates that I know of. (I’ve been running 8.0 for quite a while, and even my most recent minor OS update is at least 4 weeks ago). It just stopped working and the debug log revealed a

    2019-02-11 23:34:19 46290 [syncadapter.SyncManager] Unclassified sync error
    EXCEPTION java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.TimeZone java.util.Calendar.getTimeZone()' on a null object reference
    	at java.text.DateFormat.getTimeZone(DateFormat.java:704)
    

    Uninstalling and re-installing solved it.
    More problematic was, that it failed completely silently (until I collected debug logs). My calendar went out of sync with the server and I noticed by accident.


  • developer

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

    More problematic was, that it failed completely silently (until I collected debug logs). My calendar went out of sync with the server and I noticed by accident.

    Did you turn off notifications for DAVx⁵ or one of its notification channels?



  • @rfc2822 I do not believe so, but after uninstalling, I can’t be entirely sure.


  • developer



  • @rfc2822 I can offer the whole debug logfile from before the uinstallation if that would be any help? If you would like to take a look at it can email it to you.


  • developer

    @ccoenen Guess it won’t contain any new information, but who knows 🙂 Please send it to play@bitfire.at or upload it here



Similar topics

  • 8
  • 11
  • 7