升级后开机就提示“android.process.acore”停止运行 --分析 解决方案

来源:互联网 发布:nginx 多域名作用 编辑:程序博客网 时间:2024/06/06 09:41

OTA升级的,升级引发的所有问题都是可以解释的,有的能解决,有的不能解决。


一个项目报了这个问题。升级后开机就提示“android.process.acore”停止运行 


抓取 adb log 看到了 下面的这个 fatal  的log 


11-06 14:40:33.633  3827  3827 E AndroidRuntime: FATAL EXCEPTION: main
11-06 14:40:33.633  3827  3827 E AndroidRuntime: Process: android.process.acore, PID: 3827
11-06 14:40:33.633  3827  3827 E AndroidRuntime: java.lang.RuntimeException: Unable to get provider com.android.providers.contacts.CallLogProvider: android.database.sqlite.SQLiteException: Can't downgrade database from version 851 to 850
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:5043)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:4614)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4547)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread.access$1500(ActivityThread.java:151)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:110)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5324)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
11-06 14:40:33.633  3827  3827 E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)


从log可以看到  om.android.providers.contacts 联系人模块的数据库出问题了。问题的原因是 Can't downgrade database from version 851 to 850 ,就是说,无法从高级版本的数据库降级到低级版本的数据库。这个应该是android 的限制导致。


google 一下 为什么呢? 

stackvoerflow 有人解释了一下 ,如果你继承下面   onDowngrade 就可以了。但是是联系人是不可以这样做的吧~~

 you are using Android SQLiteOpenHelper, you need to override onDowngrade if you want to be able to run your application with a database on the device with a higher version than your code can handle.

You should care about this "Database Version thing" if ever your database schema is ever going to change (and in general, there is good chance it would).


解决方法: 先备份联系人数据。(最好是网络备份,完全备份db的话可能没有效果)

方法一 

1设置-应用程序管理--联系人--清空数据   2 设置-应用程序管理--拨号盘-清空数据


方法二、 设置-恢复出厂设置 --清空所有数据。然后自动重启到recovery 然后就可以了--等着 一会就好了


0 0
原创粉丝点击