My Gmail database is locked. How can I unlock it ?

You surely get an update of the Gmail application (>= 2.3.5) from the market or after flashing a new ROM.
With this latest Gmail application, Google introduced a limitation: the access to the Gmail message database is granted only to phone pre-installed applications.

I found 3 solutions to avoid this problem.

1rst solution
Remove the Gmail update:
– uninstall Gmail update in the Market (Market -> My Applications -> Gmail -> uninstall updates)
– in the Market, disable automatic update for Gmail
– uninstall Pure messenger
– reboot your phone
– reinstall Pure messenger from the market
– insert a fresh new widget.

Nota: Don’t skip steps … Pure messenger uninstall is VERY important. Pure messenger ask only once the permission to Android for the gmail access… If the access is denied, only a full reinstall will restart permission the process. It’s not my choice, but the Android architecture.

2nd solution
Use ‘K9 For Pure’ and configure Gmail with IMAP access.

3rd solution
The only way to bypass this protection of the new Gmail application is to use a modified version of Gmail and install it as ‘system app’.
This modified version will be the same as the current market version but with ‘old permissions’ allowing Pure messenger to read it’s message database.
Now, the drawback: to move it, you need to be root… you can follow this guide to install it.
I think the operation will need to be done on each new release of Gmail … so, don’t update Gmail from the Market.
There is an additionnal guide here to learn how to create your own version of Gmail.

90 thoughts on “My Gmail database is locked. How can I unlock it ?

  1. Hi,

    I moved the org.koxx.pure_messenger-1.apk to /system/app but it isn’t working: I keep on getting the red error message about the locked database, and if I select “Enable gmail” it gets immediatelly unchecked.

    I have uninstalled the app, rebooted, reinstalled it from the market, moved the app, rebooted and then added a widget. Same result.

    Am I missing something?

    gmail 2.3.5
    pure messenger 2.3.6
    CM 7.1 RC1 on Nexus one

    1. Currently, i doesn’t have any other solution than the 3 exposed in my blog. Try uninstalling gmail update.
      I’ll try to create a ‘gmail connector’ during next days for rooted devices.

      1. I first tried method number 2 (and I checked pure messager is not listed under “Downloaded” apps, only under “All”). Even after rebooting it twice it still complains te database was locked.

        While it was not working, I tried method nr 3 too. I downgraded gmail from and rebooted. Pure messenger does allow me to enable gmail again, but it unfortunately doesn’t show any gmail messages.

        Pure Messenger 2.3.7
        HTC Desire + Oxygen 2.1.6 (Android v2.3.4)

        Any clue what is wrong?

      2. You forgot pure messenger uninstall/reinstall after gmail downgrade……..

      3. Oops, the downgrade option of gmail just works. While it’s kind of hard to uninstall the messenger app after method #1, I removed the widget, killed the pure messenger widget and deleted all application data. After rebooting I added the widget again and it works great again.

      4. Yes, the uninstall is VERY important. Pure messenger ask only once the permission to Android for the gmail access… If the access is denied, only a full reinstall will restart the process.

  2. I used the converting the app to a system app for a cm7 2.3.5 rom and an htc sense 2.3.4 rom, both of which has gmail updated. It worked on htc sense but not on cm7. The problem seems to be that even after classifying the app as a system app in cm7, it still does not get access to the database. This might be because of a bug in cm7.

  3. I got imap set up just fine now the only problem is my open in gmail link has disappeared and now it say open in email which takes you to imap version I still need the link that just launches Gmail normal interface when I just want to launch Gmail. Can you add this open back in please. I know if I edit the email from within pure messenger that its uses the K9 I just want my link back to launch the gmail app. Thank You

  4. Found the perfect solution. After upgrading to the latest Gmail version I found no way back to the previous version. I googled Gmail version 2.3.4 and found that version, and so I uploaded it to my phone. With everything erased I executed this version and guess what? We are back to normal. Life is good.

  5. I did exactly the same thing on Cyanogenmod 7. Downgraded Gmail to 2.3.4 after Google search for link. I am going to try thunderstick since easy and see if updated client works.

  6. I used Option 3 as I found K9 for Pure didn’t reliably download my GMail mails.

    Perfection would have been to have a little more information on the Mount command and what to expect. In my case, It seemed that my HTC Wildfire used /dev/block/mtdblock3 for ‘/system/’ mounted partition. I took a wild guess that that was the correct one – and it worked (as I am not all that familiar with Linux commands).

    Now Pure Messenger is wonderfully back to normal…..


  7. PM works on my Thunderbolt with Gmail 2.3.5 and das BAMF remix v2.1 and latest Thunderstick, but not Cyanogenmod 7 RC1.3 or RC 1.4. Again, downgrading Gmail to 2.3.4 works. I have the same issue with E-mail notifier that accesses th Gmail database to create a popup for new messages. Curious why this happens with some Android setups and not others.

  8. Anders, I notice in the widget “Executive Assistant” that one can configure it to “Get from Google”, and this seems to solve the problem you’re facing. Could you do something like that in Pure Messenger, or is there something I’m missing?

    1. What does it means ? there is no standard API to get email from Google except IMAP … it would be VERY heavy, battery and CPU consuming. In that case, simply use K9FP : it does the same IMAP connexion.

  9. I somehow got Gmail 3.1.5 installed on my phone. I turned off the automatic update of Gmail so not sure how it happened. This version of Gmail no longer shows an uninstall? How can I downgrade Gmail to a version prior to 2.3.5?

  10. If you are rooted, you can also uninstall through Titanium Backup. But I only have seen up toGmail v2.3.5.2, which just came out today. It is a security update which is still incompatible with PM.

  11. I am using Solution 2 and it works fine for the widget itself. However, I can’t use native gmail app, which I think is superior than K9. Can you please add the ability to open a mail in Native android app gmail instead of K-9.

    1. Hi,
      sorry, but I think this is not a good idea to mix 2 apps. So, I won’t add this option.
      I strongly advise you to root your phone and use the modified version if you don’t like K9FP.

  12. I found a fourth solution that worked really easily. It requires root as well. I have the pro version of Titanium Backup so im not sure if this works with the free version, but what I did with this:

    With Titanium Backup: deleted my old gmail
    Download new gmail apk
    long press on the gmail app in titanium backup and select convert to system app.

    It worked for me, although i did use your 3rd solution for my previous fix for my previous gmail. i figured i’d try my way, and it worked. If anyone else can confirm this, it is a bit easier.

  13. Hi,
    I installed K9 and all eMails are displayed in this app, but Pure Messenger widget still shows no eMails. What settings do I have to change? Any solution?

  14. Hi,
    I have a Samsung Galaxy S2.
    I tried to use the 1st solution, but it’s not working.
    If I go into “Market” -> “My Applications” Gmail is not listed.
    But Gmail 2.3.5 is definately installed…

    Any idea?


    1. Hi,
      no, no idea 😦
      Sorry, but I don’t have any SGS2 to make the test.
      Clearly, the best solution is to root and install the modded Gmail.

  15. Hi!
    Ok, it seems i am a noob because nobody ask this, but which version of your great modified files i have to pick up? There are 3 times apk 4.0.1.
    Thanks for your help! And just curious: Would it be possible to do this with a one step cwm version? Or is this a different process?

    Thanks in advance!

  16. hey koxx, i installed your modified gmail apk (4.0.3, the version was exactly the same that was installed on my system) and now i don’t see the warning whene i try to configure the widget but as soon as i try to check “Enable Gmail” the pop up alert came out and i can’t enable it.

    I’m using cyanogen 9 alfa 18 (4.0.3) on nexus s

  17. Hi, I installed the modded gmail version on my galaxy nexus, and when I configure the widget it checks the enable gmail checkmark and put down my email address but when the widget appears no emails show up.
    Also if I uncheck the enable gmail case and try to recheck it, the “this is not supported from 3.0 and higher”message appears.

    1. Ahhh ! that is very interesting. It means I forgot to disable a protection ! I’ll publish a new version tonight.
      EDIT: new version published ! can you try it please ?

      1. Hi,
        I’ve Gmail.4.0.3-239410.mod-signed.apk ver of Gmail, and still no emails on the widget 😦

      2. Hi,
        can you try the 2.5.1 version please ?
        if it doesn’t works, please email me (see ‘about’ page for my email).

      1. Would you accept a 20 dollar donation for it?
        Please email me your paypal address thanks

  18. The modified versions of Gmail 4.0.1 and 4.0.2 both work in Honeycomb. Android 3.2 never released the source code so there were never any Gapps published for it as well.

  19. I have not tried Pure Messenger yet, but I plan on it. My mobile has not been updated for a while. 🙂 But good job with the ICS/Honeycomb support.

  20. I’ve downgraded gmail and stopped automatic updating, and it didn’t work.
    So I’ve installed K9 and it still doesn’t work. The K9 itself works fine and syncs with my gmail account, and I configured the pure messenger widget to use it, but I still dont see my mails on the widget.

    Please help me solve this kne out

  21. my gmail is IMAP enabled and I’m using k9 for pure messenger but I can’t get it to work in the widget. anyone got step by step instructions? I can use pop to view my gmail but it displays as a pop email 😦 if I could change the icon Iwouldn’t care but I can’t.

    1. step by step:
      1- install K9FP
      2- configure Gmail account in IMAP in K9FP
      3- check you receieve email in K9FP
      4- select K9FP as email provider AND select the K9FP account in Pure messenger, then save & exit
      Done !

  22. I knew how to do that (accidental found it). But it sure would be nice if I could select the Gmail icon along with it. There should be several different assignable icons anyway. I have several pop and Gmail accounts that would make it easy to visually tell which account they are from. JON.
    Thanks for the detailed response.

  23. I have a HTC DNA. Rooted, but when you try to modify or even delete GMail, the system restores the original on reboot. Any answers you’ve heard of?

  24. Currently, i doesn’t have any other solution than the 3 exposed in my blog. Try uninstalling gmail update.
    I’ll try to create a ‘gmail connector’ during next days for rooted devices.

  25. Android app BlingBoard still accesses gmail acvount without any “hacking” or rooting. Maybe talk with the dev and see if they can help with gmail database locking issue?

  26. Hi, I would like to ask a question about the calender sync. It was found that I input the event directly at the widget, but it doesn’t sync with my Google email. Therefore when I open my tablet, I can’t see the event on calender like “S planner”. Could you please advise???

    1. Hi, Try to select ‘android auto seletion’ for the ‘+’ widget button action in the widget config panel.

  27. Any news about accessig Gmail accounts? I wonder, if the 1st workaround has a chance to work on my Samsung Note3 – I have a 4.4.2 KK installed on it and the basic Gmail version is probably much newer then 2.3.x. (4.x in fact). I don’t want to include additional K9 connector.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s