ICSx⁵ is an Android app to subscribe to remote or local iCalendar files (like time tables of your school/university or event files of your sports team).
Somehow I managed to get this exception. The steps were:
I had already a subscription (US holidays).
Add a new subscription (Austrian holidays).
Work through the "Add subscription" dialogs. When finally clicking on the last checkmark, it fails with a Toast and this exception in adb logs:
E/icsx5: Couldn't create calendar
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: subscriptions.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:940)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:89)
at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.kt:42)
at androidx.room.EntityInsertionAdapter.insertAndReturnIdsList(EntityInsertionAdapter.kt:202)
at at.bitfire.icsdroid.db.dao.SubscriptionsDao_Impl.add(SubscriptionsDao_Impl.java:210)
at at.bitfire.icsdroid.ui.AddCalendarDetailsFragment$SubscriptionModel$create$1$ids$1.invokeSuspend(AddCalendarDetailsFragment.kt:117)
at at.bitfire.icsdroid.ui.AddCalendarDetailsFragment$SubscriptionModel$create$1$ids$1.invoke(Unknown Source:8)
at at.bitfire.icsdroid.ui.AddCalendarDetailsFragment$SubscriptionModel$create$1$ids$1.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at at.bitfire.icsdroid.ui.AddCalendarDetailsFragment$SubscriptionModel$create$1.invokeSuspend(AddCalendarDetailsFragment.kt:117)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Somehow I managed to get this exception. The steps were: