当我的 android 应用程序尝试读取 android sms 数据库时,它会崩溃。读取android sms 数据库的代码类似于下面的代码片段:
String SMS_URI = "content://sms/"; Uri uri = Uri.parse(SMS_URI); Cursor cursor = myContext.getContentResolver().query(uri, null, null, null, null);
这是我的应用程序与 android 短信数据库交互的唯一地方。正在为 sms 数据库引发降级错误。
我收到以下崩溃:
java.lang.RuntimeException: android.database.sqlite.SQLiteException: Can't downgrade database from version 58 to 55
at to.talk.utils.ExceptionThrowingFutureTask$1.run(ExceptionThrowingFutureTask.java:32)
at java.lang.Thread.run(Thread.java:856) Caused by: java.util.concurrent.ExecutionException: android.database.sqlite.SQLiteException: Can't downgrade database from version 58 to 55
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:223)
at java.util.concurrent.FutureTask.get(FutureTask.java:82)
at to.talk.utils.ExceptionThrowingFutureTask.done(ExceptionThrowingFutureTask.java:22)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
... 1 more Caused by: android.database.sqlite.SQLiteException: Can't downgrade database from version 58 to 55
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
at android.content.ContentResolver.query(ContentResolver.java:372)
at android.content.ContentResolver.query(ContentResolver.java:315)
at to.talk.app.features.growth.SMSReader.readSmsAndGetInviteList(SMSReader.java:39)
该应用程序大部分时间都可以正常工作,并且不会在本地崩溃,但是对于某些用户来说却崩溃了。在它崩溃的设备\环境中没有明显的模式。如果有人可以在这里帮助我,我将不胜感激。
我在这里发现了类似的崩溃。
虽然在这种情况下,它可能是他们自己的数据库之一,不像我的 android 短信数据库。