Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

error SQLiteConstraintException on emulator with Android N #101

Closed
toy-lin opened this issue Apr 28, 2017 · 3 comments
Closed

error SQLiteConstraintException on emulator with Android N #101

toy-lin opened this issue Apr 28, 2017 · 3 comments

Comments

@toy-lin
Copy link

toy-lin commented Apr 28, 2017

04-28 08:37:18.840 8826-9078/*** E/SQLiteDatabase: Error inserting KEY=version MIGRATED_KEY=null UPDATED=1493368638631 CREATED=1493368638631 MODULE=cookie VALUE=1
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: TrayInternal.MODULE, TrayInternal.KEY (code 2067)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:782)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1472)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343)
at net.grandcentrix.tray.provider.SqliteHelper.insertOrUpdate(SqliteHelper.java:148)
at net.grandcentrix.tray.provider.TrayContentProvider.insertOrUpdate(TrayContentProvider.java:206)
at net.grandcentrix.tray.provider.TrayContentProvider.insert(TrayContentProvider.java:187)
at android.content.ContentProvider$Transport.insert(ContentProvider.java:264)
at android.content.ContentResolver.insert(ContentResolver.java:1274)
at net.grandcentrix.tray.provider.TrayProviderHelper.persist(TrayProviderHelper.java:151)
at net.grandcentrix.tray.provider.TrayProviderHelper.persist(TrayProviderHelper.java:142)
at net.grandcentrix.tray.provider.ContentProviderStorage.setVersion(ContentProviderStorage.java:350)
at net.grandcentrix.tray.core.Preferences.changeVersion(Preferences.java:272)
at net.grandcentrix.tray.core.Preferences.isVersionChangeChecked(Preferences.java:292)
at net.grandcentrix.tray.core.Preferences.(Preferences.java:58)
at net.grandcentrix.tray.core.AbstractTrayPreference.(AbstractTrayPreference.java:31)
at net.grandcentrix.tray.TrayPreferences.(TrayPreferences.java:43)
at net.grandcentrix.tray.TrayPreferences.(TrayPreferences.java:48)
at ***.module.sp.CookiePreferences.(CookiePreferences.java:23)
at ***.util.FileTypeUtil.getCookies(FileTypeUtil.java:839)
at ***.util.Util.SendPhoneInfo(Util.java:386)
at .util.Util.access$000(Util.java:124)
at .util.Util$1.run(Util.java:371)
04-28 08:37:18.840 8826-9078/
W/Tray: Couldn't update or insert data. Uri: content://
.tray/internal_preferences/cookie/version?backup=true

Reference:

compile 'net.grandcentrix.tray:tray:0.11.1'

And code at "net.grandcentrix.tray.core.Preferences.changeVersion(Preferences.java:272)" is below:

getStorage().setVersion(newVersion);

@passsy
Copy link
Contributor

passsy commented Apr 28, 2017

I guess it's a duplicate of #96 where multiple threads change the version simultaneously. can you confirm this @linktabc? Can you reproduce this error?

@toy-lin
Copy link
Author

toy-lin commented May 2, 2017

I can't reproduce the error.
I considered they are the same problem ,i have tried to reproduce the multithreading scene and found that call "getStorage().setVersion(newVersion);" twice wouldn't result in this error.

May be they are not the same problem, because we are receiving much error report from user every day(about 300 reports per day for more than a week) all with error #96 but none of the reports include this error.This error is found by our company's tester with an Android N phone but never come up again.

@StefMa
Copy link
Contributor

StefMa commented Jul 5, 2017

I will close that since you can reproduce it.
Feel free to contact us again if the error raise again 👍

@StefMa StefMa closed this as completed Jul 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants