UNIQUE constraint failed: station._id (code 1555)

Samebug tips1

activity.OnCreate is executed every time the app launches or the screen is rotated, so, putting your DB initialization inside it will cause the DB to be called too many times causing the exception. Try to use the MyDatabase.onCreate method for this.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web305

  • UNIQUE constraint failed: station._id (code 1555)
  • via GitHub by DvTonder
    , 2 months ago
    UNIQUE constraint failed: jobs._id (code 1555)
  • via GitHub by Mygod
    , 9 months ago
    UNIQUE constraint failed: jobs._id (code 1555)
  • Stack trace

    • android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: station._id (code 1555) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId( at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId( at android.database.sqlite.SQLiteStatement.executeInsert( at android.database.sqlite.SQLiteDatabase.insertWithOnConflict( at android.database.sqlite.SQLiteDatabase.insertOrThrow( at com.vlille.checker.db.StationEntityManager.create( at com.vlille.checker.db.StationEntityManager.create( at org.droidparts.persist.sql.AbstractEntityManager$ at org.droidparts.persist.sql.AbstractEntityManager$ at org.droidparts.inner.PersistUtils.executeInTransaction( at org.droidparts.persist.sql.AbstractEntityManager.executeInTransaction( at org.droidparts.persist.sql.AbstractEntityManager.cud( at org.droidparts.persist.sql.AbstractEntityManager.create( at com.vlille.checker.db.DBUpdater.update( at com.vlille.checker.ui.async.DBUpdaterAsyncTask.doInBackground( at com.vlille.checker.ui.async.DBUpdaterAsyncTask.doInBackground( at android.os.AsyncTask$ at at android.os.AsyncTask$SerialExecutor$ at java.util.concurrent.ThreadPoolExecutor.runWorker( at java.util.concurrent.ThreadPoolExecutor$ at

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 1 year ago
    2 times, 1 year ago
    24 times, 2 weeks ago
    5 times, 2 weeks ago
    Once, 1 month ago
    68 more bugmates