[Android 8.0] NullPointerException: Attempt to invoke virtual method '…getTimeZone()' on a null object reference

Sometimes, calendar synchronization shows this error:

 

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.property.UtcProperty.<init>(UtcProperty.java:67)
[…]

 

This problem seems to be limited to Android 8.0 (probably only systems which just have updated to Android 8.0).

We were not able to reproduce this problem and we don't know the reason for this problem, but it's probably related to some error in Android 8.0 which only occurs when some cache is used. If you have an idea or more information about this problem, please let us know.

How to fix it

  1. If there are further Android updates available for your device, update your device to the latest version and try again.
  2. Otherwise, re-install DAVx⁵:
    1. Either overwrite DAVx⁵ with the same version if you know how to do that (you have to re-install the APK, for instance if you use F-Droid). If you re-install DAVx⁵ using this method, accounts and settings will be preserved.
    2. Otherwise uninstall DAVx⁵ and then install and set it up again.
  3. The problem should now be gone.