Can't edit existing carddav contacts -> crashs

  • Use Case 1:

    1. Upload the address book via another carddav client (SOGo Connector for example)
    2. Sync it with DAVdroid
    3. Switch to “Contacts to display” and select the DAVdroid Account
    4. Select an existing contact and edit it
      –> app crashs.
    03-16 14:37:57.525    6494-6494/ E/AndroidRuntime﹕ FATAL EXCEPTION: main
                at java.util.TimSort.binarySort(
                at java.util.TimSort.sort(
                at java.util.TimSort.sort(
                at java.util.Arrays.sort(
                at java.util.Collections.sort(
                at android.content.Loader.deliverResult(
                at android.content.AsyncTaskLoader.dispatchOnLoadComplete(
                at android.content.AsyncTaskLoader$LoadTask.onPostExecute(
                at android.os.AsyncTask.finish(
                at android.os.AsyncTask.access$600(
                at android.os.AsyncTask$InternalHandler.handleMessage(
                at android.os.Handler.dispatchMessage(
                at android.os.Looper.loop(
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(
                at dalvik.system.NativeStart.main(Native Method)

    Use Case 2)

    1. Switch to “Contacts to display” and select DAVdroid Account
    2. Add a new contact (Android says the contact will be synced)
    3. Save contact
    4. Edit the new contact
      –> all works as intended

    No HTC 🙂
    SEMC Xperia Pro Android 4.1.2 (API 16) CyanogenMod 10.1

    Only contacts that are similar to the local contacts will crash, if i remove these contacts, all works fine.
    In my case i remove my complete contacts

    • Navigate to Settings—>Apps—>Contacts Storage
    • Now Click Clear data

    and get all contacts via carddav …

  • developer

    Can you provide (a link to) the source code of the exact version of your Otherwise, the line numbers in the exception messages are useless.

    Setting this to “3rd-party bug” because it’s not DAVdroid that crashes but the contacts editor (and I didn’t see that here yet, even when testing with SoGo)

  • Okay, here you can find the (hopefully) right source code from cm
    Btw thats my rom i installed:

  • I experienced also problems where the contact editor just crashes when I tried to setup DAVdroid + Horde:

    • I exported my contacts to a vcf file to have a backup
    • installed davdroid
    • tried to move contacts (local / gmail) to DAVdroid account. I found no possibility to do this.
    • import backuped vcf file. done. It seems that nothing happend
    • till now the contact editor crashes
    • I also had problems with events in the calender (using aCalender App)

    I seems that now contacts have multiple “resource providers” / accounts and the apps can not handle this…?!
    I hope this notice could be helpful…


    OS: CM 10.1.3-i9100g

  • developer

    @h8h: According to the exception, there’s a NullPointerException at$ which is called from at$ However, in the source code you posted line 1276 is not in the compare() method but onEditOtherContactRequested. So I guess that’s not the correct source code version.

    @voxspox: Can you try to remove all your contacts (after exporting them, of course, and testing if the exported VCF is actually working)? If the problem then disappears, you’d have to import the contacts in bunches until the contact editor begins to crash again.

  • @rfc2822 I see … wrong source, damn nightbuilds … The proposal for deleting all the contacts was the workaround to solve this problem. I removed all my contacts and uploaded the exported vcf to the carddav server and for my mobile i let davdroid import the contacts from the carddav server. Now i can add edit and delete my whole contacts without any nullpointer problems.

  • developer

    Ok, so I’ll close this. If this issue persists and if you think that DAVdroid could do something better, please post here again and I’ll re-open.

Similar topics