Android - "com.android.phone has stopped" after dirty flashing CM13

This was because of a change in the code.

As Firelord has said, clear the data for the apps, This can be done like so (this will also delete your SMS/MMS database, so make sure to backup them beforehand):

adb shell
rm -fr /data/data/com.android.providers.telephony/
rm -fr /data/data/com.android.phone/
exit

The -f flag is for force and -r flag means recursive.


I had the same problem while upgrading to CM13 from CM12.1. You can solve this problem without deleting your database files and therefore losing data as suggested in the other answers.

The culprit seems to be broken database onUpgrade code in the TelephonyProvider of CM. The ppp_number column of the carriers table does not exists, but the upgrade code assumes it already exists.

I solved it by copying the telephony.db to my local Linux machine and reverting the database version to version 16 << 16 | 6 = 1048582 to force the upgrade code to add the missing columns. The ALTER TABLE statements in the linked code are guarded by try-catch-blocks, so that it doesn't matter if some of the columns already exists. Boot the phone into recovery (e.g. TWRP) to have adb root priviliges and avoid lock races with the Android Runtime which is constantly trying to start the telephony provider.

% adb pull /data/user/0/com.android.providers.telephony/databases/telephony.db
% adb pull /data/user/0/com.android.providers.telephony/databases/telephony.db-journal

Create backups

% cp telephony.db telephony.db.bak
% cp telephony.db-journal telephony.db-journal.bak

Then open the database with sqlite and set the version

% sqlite3 telephony.db
sqlite> PRAGMA user_version = 1048582;
sqlite> .quit

Upload the changed database back to the device and fix permissions

% adb push telephony.db /data/user/0/com.android.providers.telephony/databases
% adb shell
~ # cd /data/user/0/com.android.providers.telephony/databases
/data/data/com.android.providers.telephony/databases # rm telephony.db-journal
/data/data/com.android.providers.telephony/databases # chown radio:radio telephony.db
/data/data/com.android.providers.telephony/databases # chmod 660 telephony.db

You could also try this on the broken system, which I wouldn't recommend. You would probably have to become root with adb root in order to copy and modify the files with adb.


I tried Sebastian's solution, but the error persisted. The accepted answer results in losing all your SMS, therefore was not an option for me. However, after booting into recovery mode and deleting the files

/data/data/com.android.providers.telephony/databases/telephony.db
/data/data/com.android.providers.telephony/databases/telephony.db-journal

the phone worked perfectly again. The files seem to contain only auto-generated data, so it is safe to delete them.