Android.database.sqlite.SQLiteConstraintException: contacts.pinned may not be NULL (code 19)



  • This bug just hit me and was gone after deleting the affected contact from the server. I believe i triggered the issue by adding the contact first and moving it into a contacts group using the ownCloud webinterface later after syncing.



  • I’m having the same issue with Alcatel 5038D stock rom, DAVdroid 0.7.2.



  • I fixed the problem starring the contact and syncing. Then I can unstar it and it syncs OK from now on.


  • developer

    And again with 0.7.5 (from Play Store):

    Moto X (ghost) with Android 4.4:

    android.database.sqlite.SQLiteConstraintException: contacts.pinned may not be NULL (code 19)
    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:173)
    at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:160)
    at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:512)
    at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:377)
    at at.bitfire.davdroid.resource.LocalCollection.commit(LocalCollection.java:327)
    at at.bitfire.davdroid.resource.LocalAddressBook.commit(LocalAddressBook.java:156)
    at at.bitfire.davdroid.syncadapter.SyncManager.pullChanged(SyncManager.java:210)
    at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(SyncManager.java:91)
    at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(DavSyncAdapter.java:146)
    at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
    

  • developer

    According to https://github.com/android/platform_packages_providers_contactsprovider/blob/android-5.1.1_r4/src/com/android/providers/contacts/ContactsDatabaseHelper.java#L1213, the RawContact’s PINNED is always DEFAULT unpinned, so there should be no need to set it explicitly.


Log in to reply
 

Similar topics