Open AChep opened 3 years ago
Can you reproroduce this with the ExoPlayer demo app as well?
If this happens only with your app can you add some details about the DatabaseProvider
that you are using? Like where is the database supposed to be stored and does the app have permission to access it (eg. on external storage)?
I'm using the ExoDatabaseProvider
with the default configuration. No, I'm unable to reproduce it and have never seen it on my test device.
How many occurrences of this issue are you actually seeing in production? If the volume of crashes is very low, then it's probably a platform issue related to some rarely occurring state, which would be much less worth investigating.
This does not happen frequently, the user has a chance of ~0.0007 to witness the crash by himself in 30 days.
@ojw28 I am also getting similar crash. For me it crashed 944 times for 912 users in last 90 days, so this is blocker crash for the app.
Fatal Exception: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5 SQLITE_BUSY) at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(SQLiteConnection.java) at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:776) at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:654) at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:110) at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:1017) at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:1005) at android.database.sqlite.SQLiteDatabase.getVersion(SQLiteDatabase.java:1094) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:389) at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:340) at com.google.android.exoplayer2.upstream.cache.CachedContentIndex$DatabaseStorage.exists(CachedContentIndex.java:798) at com.google.android.exoplayer2.upstream.cache.CachedContentIndex.initialize(CachedContentIndex.java:201) at com.google.android.exoplayer2.upstream.cache.SimpleCache.initialize(SimpleCache.java:582) at com.google.android.exoplayer2.upstream.cache.SimpleCache.access$000(SimpleCache.java:49) at com.google.android.exoplayer2.upstream.cache.SimpleCache$1.run(SimpleCache.java:268)
I am using Room as the local database and exoplyer2 for playing and downloading video.
I checked on SO for solution and as per this https://stackoverflow.com/a/7930375/7322895, we can handle this by using only 1 instance of SQLiteOpenHelper
. But when we use exoplanyer's DatabaseProvider
it uses old android.database.sqlite.SQLiteOpenHelper
class and Room uses latest androidx SQLite androidx.sqlite.db.SupportSQLiteOpenHelper
class. Can we migrate to new androidx library for database access, so that we can provide room database to exoplayer's SimpleCache
and there by creating only 1 instance of SQLIteOpenHelper
in the app?
@chhatrasal01 Maybe the fix in #10959 will help with this (the error looks the same).
It has happened on these devices:
It seems to be related to the https://github.com/google/ExoPlayer/issues/8251 although I do not alter the configuration.