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

  • developer

    Still no idea what the reason could be.

    @S2- @chiisama Which exact Android version do you use? The stock version (of which brand)? CyanogenMod?

    At the moment, I guess this is an issue with a few manufacturer-adapted Android versions.

  • i’m on cyanogenmod. latest stable.
    deleting the contact that generated the error and recreating it solved the problem for me. it never happened again.

  • Cyanogenmod last 11-20141115-SNAPSHOT-M12-i9300 (4.4.4)
    S2 - How you now which one cause the error ?

  • @chiisama i watched the logs with adb while syncing, and the last one that appeared before the exception was the guilty one.

  • The last one was Bengali Ottenau in the log above. Deleting this does not help.
    I removed the carddav account in davdroid and readded it. Error gone.
    The only thing that I did that may can corrupt the database is the SDMaid app.
    This app has the option to “optimize” the database. I tried to reproduce the error running sdmaid again but no problem wiht davdroid yet.

  • 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(
    at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(
    at android.content.ContentProviderProxy.applyBatch(
    at android.content.ContentProviderClient.applyBatch(
    at at.bitfire.davdroid.resource.LocalCollection.commit(
    at at.bitfire.davdroid.resource.LocalAddressBook.commit(
    at at.bitfire.davdroid.syncadapter.SyncManager.pullChanged(
    at at.bitfire.davdroid.syncadapter.SyncManager.synchronize(
    at at.bitfire.davdroid.syncadapter.DavSyncAdapter.onPerformSync(
    at android.content.AbstractThreadedSyncAdapter$
  • developer

    According to, the RawContact’s PINNED is always DEFAULT unpinned, so there should be no need to set it explicitly.

Similar topics