microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
7.75k stars 1.63k forks source link

[WhatsApp] Cannot setup backups / MicroG stuck on a loop: "Account Already Exists" #1988

Open dcarrera opened 1 year ago

dcarrera commented 1 year ago

App Name: WhatsApp

I encountered this bug when trying to setup WhatsApp backups to my Google Drive. But I don't think this bug is specific to WhatsApp. It looks like a repeat of #1403 and #1847.

Steps on WhatsApp:

  1. Go to WhatsApp > Settings > Chats > Chats backup
  2. Under "Google Account" it says "None selected".
  3. Click on "Google Account".
  4. New page says "microG Services Core".
  5. Click on "Sign In"
  6. I get a Google sign in page. Enter email & password & 2FA.
  7. Login successful, "please accept terms and conditions". Click "I Agree"

After this I am back to the WhatsApp chat backup page, but no Google account is selected.

  1. Click on "Google Account" again.
  2. Click "Sign In" again.
  3. Enter email again.
  4. Error: "This account already exists on your device."

If I go to system settings > passwords & accounts, I can see the Google account listed. If I delete the Google account I can go back to WhatsApp and try steps 1-7 above, and I get the same result. In the end, no google account is selected.

Steps without WhatsApp:

  1. Go to microG settings.
  2. Under Accounts it says "Add Google account".
  3. Click on Accounts.
  4. I get the same "Sign in" page from microG that I saw from WhatsApp.

Same error occurs:

  1. Click on "Sign In" again.
  2. Enter email again.
  3. Error: "This account already exists on your device."

System: Android Version: 13 Custom ROM: Calyx OS 4.11.0

microG: microG Core version: 0.2.25.223616-76 microG Self-Check results: All ticked

freechelmi commented 12 months ago

AFAIK the Google drive API is not supported which may explain this behaviour.

dcarrera commented 12 months ago

That can't be it because I showed a way to reproduce the same bug with just MicroG, without WhatsApp. I can go to the MicroG settings and try to add an account, and I get stuck on the same login loop.

marcdw1289 commented 11 months ago

Maybe this?

1824

ale5000-git commented 11 months ago

The version of microG stated on the first post is old, maybe it already works on the latest version. Could you all please retry with it?

dcarrera commented 11 months ago

I don't know how to change the microG version on Calyx OS. In fact, it looks to me like microG is a core component of the OS that cannot be upgraded or removed individually.

However, I found a different way to solve my problem. It turns out that WhatsApp has an option to migrate your data from an old phone to a new phone directly. It's in Settings > Chats > Transfer Chats. It looks to me like one phone is acting as a hot spot and the new phone is downloading the data directly. This method circumvents Google Drive entirely and works flawlessly with microG, so that's what I went with in the end.

ale5000-git commented 11 months ago

It is integrated in the OS but it can still be updated separately as normal app (at least on normal Android ROMs it is like this); you just need to find the updated apk (signed by Calyx OS).

There a link for the updates here: https://github.com/micro5k/gmscore-info

trunksn1 commented 11 months ago

Try this: https://github.com/microg/GmsCore/issues/1847#issuecomment-1657101475

it worked for me to log in ReVanced

Ten0 commented 7 months ago

The version of microG stated on the first post is old, maybe it already works on the latest version. Could you all please retry with it?

@ale5000-git I've got the latest microg (0.3.0.233515) and I still see this issue. On the page where I'm supposed to pick the google account it knows of no google account, and if clicking add it complains that it's already added. Whatsapp backups are stored in Drive: https://www.androidpolice.com/find-whatsapp-backups-google-drive/

HOWEVER I finally figured out how to restore from a backup file: on my previous Android version whatsapp data was stored at /sdcard/WhatsApp, and the corresponding path on the new Android version is /sdcard/Android/media/com.whatsapp/WhatsApp. Moving the folder from my file backup to the appropriate path caused WhatsApp to detect its old local database and allow me to restore on first boot.

CRCasper commented 5 months ago

I was experiencing this issue and finally found a solution, maybe it'll be helpful to others- Settings > Accounts > click your google account that you entered through microG > Legacy Settings > "Allow apps to find accounts". This was switched off for me and switching it on allowed whatsapp to fins my account.

AyoungDukie commented 3 months ago

I was experiencing this issue and finally found a solution, maybe it'll be helpful to others- Settings > Accounts > click your google account that you entered through microG > Legacy Settings > "Allow apps to find accounts". This was switched off for me and switching it on allowed whatsapp to fins my account.

This allowed things to work for me; I also made sure to kill WhatsApp and relaunch before attempting, and had to select it twice, but it did work!

My recommendation would be to add some kind of pop-up asking users to confirm this setting after it's added, since this seems like a common bug being filed for various apps

TheHighGroundWins commented 3 months ago

I was experiencing this issue and finally found a solution, maybe it'll be helpful to others- Settings > Accounts > click your google account that you entered through microG > Legacy Settings > "Allow apps to find accounts". This was switched off for me and switching it on allowed whatsapp to fins my account.

This finally worked, way better than removing my account and logging in.

matsimon commented 1 week ago

I was experiencing this issue and finally found a solution, maybe it'll be helpful to others- Settings > Accounts > click your google account that you entered through microG > Legacy Settings > "Allow apps to find accounts". This was switched off for me and switching it on allowed whatsapp to fins my account.

I had to first enable "Allow apps to find accounts", then disconnect the Google Account from microG (deleting it by the ROM's accounts settings) - and only after re-adding. So basically with microG 0.3.2.240913-19 on CalyxOS that's what I had to do:

In microG

  1. Verified the self-check show checkboxes ticked
  2. Google Accounts > Check that Allow apps to find accounts is enabled (as of this version there is no "Legacy Settings")
  3. If you are already signed in with a Google Account, tap on the account, on the next menu tapped on the Google Account and then "Remove Account"
  4. Re-added the Google Account microG

Android settings:

  1. In the Android settings granted all permissions to Whatsapp (that part might not be required, but based on Reddit )
  2. Force stop Whatsapp, maybe even wipe all Whatsapp data
  3. Accounts > + Add account > Whatsapp
  4. Follow the WhatsApp wizard and it should recognize your Backup (at least did here).

Should the restore stay stuck like it did for me during media restore, stop the app via Android settings and restart it. At least this helped WhatsApp restarting and properly finishing the restore at the the second start.