How to debug DAVdroid-related problems

At first, please make sure that you

  1. are using the latest DAVdroid version and the latest version of your server software,
  2. have browsed through the DAVdroid FAQ, where the most common problems and their solutions are listed,
  3. have looked at our Tested services page for your server.

If you're still experiencing problems with the latest DAVdroid version, you can use the "log to external file" function (DAVdroid / Settings / Log to external file, see screenshot). It writes information about the whole synchronization (including which resources have been found locally and on the server and how they have been processed) to log files on your SD card. DAVdroid will display the directory name so that you can download and view the log files.

Useful information can often be found in the server logs, too (Web server logs and especially application server logs, e.g. Nextcloud logs). If you don't have access to your server logs and/or you're not experienced in interpreting them, you can ask your IT or server support.

Also, check if the problem is caused by

Common methods to fix problems

If you don't find a specific solution for your problem, you can always try these general methods:

  • In case a problem is related to a specific contact/event/task, delete this resource on the server and on your Android device and force synchronization.
  • In case a problem is related to a specific address book/calendar/task list, disable this collection in the DAVdroid account (uncheck it in the list), force synchronization, enable it and force synchronization again.
  • If this doesn't help, delete the DAVdroid account on your device and add it again.
  • If this doesn't help, uninstall DAVdroid, reboot your device, then install DAVdroid and add the account again.

Android debugging

With adb, you can do powerful things with your Android device (you have to turn on USB debugging; no root required). It comes with the Android SDK, but also as a standalone package for most operating systems.

You don't need to install adb to see the DAVdroid debug logs. You can use DAVdroid file logging (DAVdroid / Settings / Log to external file) instead.

However, DAVdroid isn't allowed to read system logs (debug output of system processes), so it can't put system logs into its external log files. To view system logs, use adb logcat. To get full DAVdroid logs in logcat:

  1. force-quite DAVdroid
  2. do adb setprop log.tag.davdroid VERBOSE to set the appropriate log levels
  3. do adb logcat again
  4. start DAVdroid again, force-sync

You can also see how contacts/events are really stored on your system:

  • list Android calendars with
    adb shell content query --uri content://
  • list Android events with
    adb shell content query --uri content://
  • list Android raw contacts with
    adb shell content query --uri content://
  • view details of an Android raw contact with
    adb shell content query --uri content://{RawContactID}/data

Source code

To verify a potential bug, you may find it helpful to take a look into the DAVdroid source code.

Last updated: 12 Oct 2018