I opened the Terminal Emulator and typed:
$ su
# logcat
Then I held 'Volume down' (a.k.a. Ctrl) and 'c' to stop the output. I scrolled a bit up in the output and found a line that said:
E/SQLiteOpenHelper( 5231): Couldn't open alarms.db for writing (will try read-only):
E/SQLiteOpenHelper( 5231): android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 5
OK, so this is where it's breaking. I wasn't really interested in finding out what should the proper combination of ownership/permissions for the file as I didn't really trust it would end just here, downgrading database version offers a range of situations that can go wrong. And since I don't really care for my past alarm clock times, I got rid of the old database:
# cd /data/data/com.android.deskclock/databases
# mv alarms.db alarms.db.bak
Problem solved.
amazing. nice work...
ReplyDeletey my lg optimus 2x, always prompt this " Unfortunately, clock has stopped "...I already Use what you are showing above? I am using NOvaHD cm9
ReplyDeleteWow thank you so much! You just made my day.
ReplyDeleteThank you WOW it worked. Had exact same problem. Will use logcat more often for sure!
ReplyDeleteThx my friend~ it worked~
ReplyDeleteI once had the same problem on my AOKP hd2~
Just took a Nexus 10 with Jelly Bean on it getting the same error after about a day. I tried this and it didn't work. Wouldn't even recognize such and logcat. Am I messing up syntax in terminal emulator? H-e-l-p!
ReplyDeleteAwesome! Easiest fix yet for my Samsung Galaxy S2 running Cyanogenmod 10.
ReplyDeleteWow. A little peeved it was something so simple. CM10.1 Nightly on a Captivate.
ReplyDeleteThis worked for me (Xperia Arc S - CM9.1)
ReplyDeleteIt had never occurred to me to look at the log files; despite my being an embedded systems developer. I mustn't be very good :)
hi i am using the same phone as you..but cant fix this problem, do you mind telling me how to fix it, step by step? Thank you :)
DeleteGreat work. Renamed the alarm.db file and it did the trick
ReplyDeleteDeleted the old .bak file now.I had this issue on my Samsung Galaxy S2 after upgrading from Slim Bean 3.x to the latest version (at the time of this post) 4.2.1 RC1, I gather because the ROM changed the type of clock but used the same database. All good now, thanks.
This comment has been removed by the author.
DeleteYes, I renamed the alarm.db file and it worked for me. The terminal emulator commands did not work for me.
DeleteThank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
ReplyDeleteTo clear the database and any data cached already, you can also find the Clock app in your app drawer, press and hold, then drag it up to the App Info icon. From here if you choose to Clear Data it will get rid of the ill-permissioned database and allow the app to create a new one with the appropriate permissions.
ReplyDeleteThumbs up Zoey!!!!!!
ReplyDeleteThanks Zoey!! That worked.
ReplyDeleteI have fought that problem for over a year and finally got annoyed enough to search for a fix. Thanks so much for posting!
ReplyDeleteHey Thanks, that did the trick.
ReplyDeleteWhat if it says the database not found?
ReplyDeleteThanks, this has been bugging me for weeks.
ReplyDeleteThanks, worked for me too! On kitkat, even.
ReplyDeleteThanks, worked on Slim Kat wondrously...
ReplyDeleteunfortunately emain has stopped how to fix this
ReplyDeleteGreat Wrok Man, Smooth and simple.
ReplyDeletethanks, currently I upgrade my galaxy wonder cm10 to cm11. and the problem solved
ReplyDeleteThank you for your help :) It works for me with my slimkat rom
ReplyDeleteMy clock stopped working and I cannot set the alarms. This method worked once for me, but the problem returned, and I could not fix it anymore. Nevertheless, there is something strange I saw. I deleted the caches, the data, do junk cleansing on the my phone, disabled the phone and re-enabled it. After these steps, I saw that the most current alarm settings disappeared, and the alarm settings of some time ago returned. I suspect there are hidden backup/cache/whatever files that the clock is clinging to, that prevents the clock from going back to normal, that I need to delete. Can anybody help?
ReplyDeleteTried but 'permission denied on alarms.db', so I went to app settings and cleared data/cache and tried again. This time 'no such file alarms.db', but everytime i try to modify an alarm its the same error message galaxy gt1900). Thanks anyway
ReplyDeleteThanks it works on Android L on Xperia SP
ReplyDeletethanks! worked on CM11
ReplyDeleteThank you very much! It worked flawlessly here!
ReplyDeleteThanks, your tip worked for me too (galaxy s4 mini, CM12 lollipop 5.1.1).
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi All, I had this issue , was trying out one rom after the other as none of the suggestions including deleting the clock db worked for me.After lot of digging , at last the issue in my case turned out to be a corrupt system & internal memory partitions.Once they were fixed the issue did not reappear on the next rom installed.
ReplyDeletePlease note that this is an one off case and please try the solution at your own risk and only after understanding thoroughly about what is suggested as a possibility. I'm not responsible for bricked devices.
I upgraded to cm12.1 this week and everything worked perfectly except for this. LG G2 LS980 (Spint) - this fix worked! Thanks so much!
ReplyDeleteWorked like a charm. I often forget that Android has a Linux underpinning.
ReplyDeleteThanks m8!! It worked :D
ReplyDeleteWorked 4 me on cm 12.1! Thank u!
ReplyDeleteI could not find alarm.db at all... One plus one - Cyanogenmod 13... upgraded recently and getting the message "unfortunately clock stopped working" once I click on the clock widget.... has the file structure or .db name different here
ReplyDeleteI could not find alarm.db at all... One plus one - Cyanogenmod 13... upgraded recently and getting the message "unfortunately clock stopped working" once I click on the clock widget.... has the file structure or .db name different here
ReplyDeletei opend the terminal imulator and typed thw command it replys that file not found ?
ReplyDeleteplz hlp ?
i opend the terminal imulator and typed thw command it replys that file not found ?
ReplyDeleteplz hlp ?
i opend the terminal imulator and typed thw command it replys that file not found ?
ReplyDeleteplz hlp ?
Thank you!
ReplyDeleteAlthough I didn't have those entries in muy $logcat, I did change alarma.db and TVE message is gone.
I'm on cm11, Samsung Galaxy Tan 2.
This comment has been removed by the author.
ReplyDeleteThanks, realy work on cm13 google's clock app.
ReplyDeleteBravo! Im running MM with a geris s5 duos rom from xda-developers. This fixed my problem as well. Though my file structure was a bit different. Thanks. Now for the folder mount error. ;-)
ReplyDeleteWorked like a charm, thanks so much.
ReplyDeleteThanks for letting me know that such a thing exists.
ReplyDeleteI have the same problem with Clock after I installed cm13 custom ROM on Lenovo A7000. Your instructions helped me fix the problem.
Thanks.
Sydney House Levelling service is a helping hand for people who so ever request for service related to house Levelling. This service provider has proclaimed its position as the most reliable and user-friendly service that fast as well as highly efficient in their service. The technician associated with the service provider guarantees the highest range of workmanship for the construction industry to underlying the site-specific problem such as cheap underpinning.
ReplyDelete