Message notifications stuck! I've had my Moto X (first gen) for a while, I think almost a year Noe, the whole experience has been great but lately every time I open my messaging app I get a "Two messages could not be sent" notification I can swipe it away but it will just return if I'm in the messaging app or whenever I open the app back up. This is the stock messages app I'm talking about too, so I don't have a clue why it itself would be buggy.. I've tried deleting all my messages, restarting my phone, clearing the data/cache and so far nothing has worked it continues to haunt me everytime the app is opened and its really starting to get on my nerves how do I get rid of this??
Introduction:

Heres what seems to have worked for me:

Warning !!! : The following has the potential of doing damage to your phone. Please make a full backup of your phone first and only do this if you understand what each command is doing!

The following requires some understanding of the use of ADB (Android Debug Bridge) and sqlite3 databases as well as linux permissions.

The error message I was getting in the Notification Area is similar to: Message not sent. Touch to review the message and try again.

Steps to Fix:


Reboot your phone into recovery mode. And connect your phone to your computer via USB cable.
Copy the mmssms.db sqlite database from your phone by using ADB :

adb pull /data/data/com.android.providers.telephony/database/mmssms.db

adb pull /data/data/com.android.providers.telephony/database/mmssms.db-journal
Download install "DB Browser for SQLite" on your computer from http://sqlitebrowser.org/
Open mmssms.db using "DB Browser for SQLite" (make sure the mmssms.db-journal file is in the same directory as mmssms.db).
Select the Browse Data tab.
Select pending_msgs table and then select and delete all records in this table with the Delete Record button. Repeat this for the sr_pending table.
Select pdu table, then insert 0 in read filter, then select and delete records with Delete Record button where the read column is 0. repeat this on sms and threads table.
Select Write Changes from the File menu.
Now use ADB to push the modified mmssms.db file back to your phone. But first check the permissions that have been set on the original mmssms.db:

adb shell

ls -la /data/data/com.android.providers.telephony/databases/


-rw-rw---- radio    radio      900000 2015-01-17 21:33 mmssms.db
-rw-rw---- radio    radio       30000 2015-01-17 21:33 mmssms.db-journal
-rw-rw---- radio    radio      170000 2015-01-17 21:30 telephony.db
-rw-rw---- radio    radio        8000 2015-01-17 21:30 telephony.db-journal



exit
Copy the modified mmssms.db database back to the phone:

adb push mmssms.db /data/data/com.android.providers.telephony/database/mmssms.db
Change permissions and delete old database journal file using ADB Shell

adb shell

chmod 660 /data/data/com.android.providers.telephony/databases/mmssms.db
 chown radio:radio /data/data/com.android.providers.telephony/databases/mmssms.db
 rm /data/data/com.android.providers.telephony/databases/mmssms.db-journal

exit
Disconnect your phone, reboot and see if this solved the problem.


References:

[1] http://puremon.egloos.com/m/2145353