android.database.sqlite.SQLiteException:不能降级从版本58的数据库,以55为Android SMS数据库 [英] android.database.sqlite.SQLiteException: Can't downgrade database from version 58 to 55 for android sms database

查看:2093
本文介绍了android.database.sqlite.SQLiteException:不能降级从版本58的数据库,以55为Android SMS数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个崩溃在我的Andr​​oid应用程序,当它试图读取Android的SMS数据库。在code读取Android的SMS数据库是类似于下面的代码片段:

I get this crash in my android application when it tries to read the android sms database. The code for reading the android sms database is similar to the following snippet:

字符串SMS_URI =内容://短信/;   开放的我们的uri = Uri.parse(SMS_URI);   光标光标= myContext.getContentResolver()查询(URI,NULL,NULL,NULL,NULL);

String SMS_URI = "content://sms/"; Uri uri = Uri.parse(SMS_URI); Cursor cursor = myContext.getContentResolver().query(uri, null, null, null, null);

这是我的应用程序的Andr​​oid短信数据库交互的唯一地方。被抛出的降级错误SMS数据库。

This is the only place where my application interacts with the android sms database. The downgrade error is being thrown for the sms database.

我得到以下崩溃:

 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)

应用程序工作正常大部分的时间,从来没有在本地崩溃对我来说,但它崩溃的一些用户。有在装置\环境对于其崩溃没有明显的图案。我真的AP preciate如果有人可以帮助我在这里。

The application works fine most of the time and never crashes for me locally, however it crashes for some of the users. There are no noticeable patterns in the devices\environments for which it crashes. I would really appreciate if someone could help me out here.

我发现了一个类似的崩溃在这里:

I found a similar crash here:

[https://crash-stats.mozilla.com/report/list?signature=android.database.sqlite.SQLiteException%3A%20Can%27%27t%20downgrade%20database%20from%20version%2033%20to%2032%20at%20android.database.DatabaseUtils.readExceptionFromParcel%28DatabaseUtils.java%29][1] 虽然在这种情况下,它可能是自己的数据库不像煤矿之一,其在Android SMS数据库。

[https://crash-stats.mozilla.com/report/list?signature=android.database.sqlite.SQLiteException%3A%20Can%27%27t%20downgrade%20database%20from%20version%2033%20to%2032%20at%20android.database.DatabaseUtils.readExceptionFromParcel%28DatabaseUtils.java%29][1] Though in this case it might be one of their own databases unlike mine where its the android sms database.

推荐答案

我可能会迟到了,但这里是我的2美分。

I might be late to the party, but here are my 2 cents.

您正在使用的供应商(设备的短信提供商)读取和写入,你(作为第三方应用程序)都没有打开的数据库。它的工作原理是你们两个人之间的媒介。

The provider you are using (the sms provider of the device) reads and writes to a database that you (as a 3rd party app) have no access to it. It works as a medium between the two of you.

看起来,这一得到这个异​​常的设备有其SMS数据库更新(或更precise降级)。这可以通过一个Android版本升级(由OEM)或不小心而有root访问权限改变的东西发生无论是。

It looks like that the device that got this exception had its sms database updated (or to be more precise downgraded). This can happen either by a Android version upgrade (by a OEM) or by carelessly changing stuff while having root access.

有时候,当一个设备得到了Android操作系统的更新,有些东西出问题。因为一个坏的安装不是,或者因为更新是马车。在这种情况下,有人拧SMS提供

Sometimes, when a device gets a Android OS update, some stuff go wrong. Either because of a bad installation, or because the update is buggy. In this case, someone screwed the sms provider.

底线,你(作为第三部分的应用程序)可以无能为力,除了包装与尝试渔获所有SMS提供查询)。使用同一供应商的所有应用程序应该面对完全相同的问题,因为你。

Bottom line, you (as a 3rd part app) can do nothing about it, exception wrapping all your sms provider queries with try-catches). All apps that use the same provider should face the exact same issue as you.

这篇关于android.database.sqlite.SQLiteException:不能降级从版本58的数据库,以55为Android SMS数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆