Saturday, July 14, 2012

[SOLVED] Unfortunately, Clock has stopped

When I upgraded my xperia ray from CM7 to CM9(FXP128), I was greeted by the message 'Unfortunately, Clock has stopped' whenever the phone started and anytime I touched the Clock widget. Apart from being annoying it meant I couldn't set my alarms so this became a priority one issue :-)

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.

25 comments:

  1. y my lg optimus 2x, always prompt this " Unfortunately, clock has stopped "...I already Use what you are showing above? I am using NOvaHD cm9

    ReplyDelete
  2. Wow thank you so much! You just made my day.

    ReplyDelete
  3. Thank you WOW it worked. Had exact same problem. Will use logcat more often for sure!

    ReplyDelete
  4. Thx my friend~ it worked~
    I once had the same problem on my AOKP hd2~

    ReplyDelete
  5. 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!

    ReplyDelete
  6. Awesome! Easiest fix yet for my Samsung Galaxy S2 running Cyanogenmod 10.

    ReplyDelete
  7. Wow. A little peeved it was something so simple. CM10.1 Nightly on a Captivate.

    ReplyDelete
  8. Excellent fix for my HTC One S on JellyBam 3.3

    ReplyDelete
  9. This worked for me (Xperia Arc S - CM9.1)
    It had never occurred to me to look at the log files; despite my being an embedded systems developer. I mustn't be very good :)

    ReplyDelete
  10. Great work. Renamed the alarm.db file and it did the trick
    Deleted 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.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  11. Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

    ReplyDelete
  12. To 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.

    ReplyDelete
  13. I have fought that problem for over a year and finally got annoyed enough to search for a fix. Thanks so much for posting!

    ReplyDelete
  14. What if it says the database not found?

    ReplyDelete
  15. Thanks, this has been bugging me for weeks.

    ReplyDelete
  16. Thanks, worked for me too! On kitkat, even.

    ReplyDelete
  17. Thanks, worked on Slim Kat wondrously...

    ReplyDelete
  18. unfortunately emain has stopped how to fix this

    ReplyDelete
  19. Great Wrok Man, Smooth and simple.

    ReplyDelete