相关疑难解决方法(0)

Android SQLiteException:无法将db的语言环境更改为"en_US"

我最近更新了我的一个(开源)Android应用程序,我的用户正在获得一个我无法复制的例外.关键部分是:

android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5)

然后

Caused by: android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.airlocksoftware.hackernews/databases/hacker_news_cache.db' to 'en_US'.

这种情况发生在使用Android 2.3 - 4.2.1的设备上,并且在我尝试连接数据库的应用程序中的多个位置.我使用它后关闭数据库.

我找不到有关"未能更改db语言环境"异常的更多信息.当我查看SQLiteConnection源代码(第386行)时,它似乎是'android_metadata'表或'使用新的语言环境更新索引'的问题.

这是导致异常的代码(在Github上).

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.support.v4.content.ModernAsyncTask$3.done(ModernAsyncTask.java:137)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
at java.util.concurrent.FutureTask.run(FutureTask.java:239)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856) Caused by: android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.airlocksoftware.hackernews/databases/hacker_news_cache.db' to 'en_US'.
at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:386)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:218)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
at …
Run Code Online (Sandbox Code Playgroud)

sqlite android sqliteopenhelper

16
推荐指数
1
解决办法
8419
查看次数

标签 统计

android ×1

sqlite ×1

sqliteopenhelper ×1