標籤:android style io color ar os java sp strong
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 然後就可以了--等著 一會就好了
升級後開機就提示“android.process.acore”停止運行 --分析 解決方案