Skip to content

Instantly share code, notes, and snippets.

@rorar
Last active July 3, 2024 15:56
Show Gist options
  • Save rorar/4dea6337f068f87024699ad36a7a2116 to your computer and use it in GitHub Desktop.
Save rorar/4dea6337f068f87024699ad36a7a2116 to your computer and use it in GitHub Desktop.
Solution: Google Account not syncing on Android - How to fix Google account sync issues

Sometimes Google won't sync your Google Account on android and the syncing process is stuck. There are several reasons why your Google Account won't sync.

Therefore your first visit should be the official Google Documentation 'Fix account sync issues'

If this won't fix your problem, come back here and follow these instructions.

⚠️ Disclaimer:

You'll be working with a command shell and adb. Playing around can mess up your device and/or can lead to a bricked (unusable) devices and/or data loss. I take no warranty for any physical /non-physical damages of your device.

TLDR; Follow the instructions at you own risk.

IMPORTANT: Create a backup of your device before you continue. Recommendation: Swiftbackup + Shizuku

How fix Google Account not syncing on Android without removing / re-adding the Google account:

1. Install ADB the easiest way (Windows)

The easiest way to get adb is to use "Latest ADB Fastboot and USB driver installer tool".

This tool automates the steps needed to install ADB on your device.

You won't need the "Android SDK Platform Tools" for this method.

1.1. Get the tool here and download 'Latest-ADB-Installer.bat':
https://github.com/fawazahmed0/Latest-adb-fastboot-installer-for-windows/releases/

1.2. Follow the instructions here:
https://github.com/fawazahmed0/Latest-adb-fastboot-installer-for-windows?tab=readme-ov-file#steps

2. Connect your device over USB to the ADB

Simply follow the linked instructions.

2.1. Activate the Developer Options

2.2. Activate USB Debugging

2.3. Connect your android device to your computer; Under the Dialog "Use USB for," select File Transfer / “file transfer (MTP)”.

2.4. Open command prompt by searching for "cmd" and type in:

adb devices

2.5. Check your device, optionally tick the box "Always allow connection from this computer" and hit "allow"

2.6. again type in:

adb devices

to finally connect your device.

3. Android Logcat: Check your logs and first try to resolve the issue

It can occure that an older configurations (config files) of previous Google Apps are still present (means, by some reasons they weren't updated after an App Update).

3.1. To check this, navigate to you C:\ drive and create a folder called "logcat" (C:\logcat) and just run

adb logcat tag1:OperationException tag2:"Phenotype API error" tag3:"Stale snapshot" > C:\logcat\logcat_grep.txt

3.2. On your phone, go to

Settings > User and Accounts > [email protected] > Sync now

Notes:

  • on some devices, the naming convention for User and Accounts is different. It maybe just "Accounts"
  • on some devices the Sync Button is hidden behind the three dotted dropdownmenu on the top right. - DUMMY = choose your Accounts email address

3.3. Here's our first try 👍:

Inside your command prompt, enter

adb shell requestsync -F

3.4. Open the logcat_grep.txt and check if something like these message occoured:

OperationException[Status{statusCode=Stale snapshot for com.google.android.libraries.performance.primes#com.google.android.googlequicksearchbox(change count changed - expected 234 but was 233), resolution=null}]

and/or

Phenotype API error. Event: # fklr@8c912988, EventCode: COMMIT_CONFIG [CONTEXT service_id=51 ]
cwdf: 29501: Stale snapshot for com.google.android.libraries.notifications#com.google.android.googlequicksearchbox(change count changed - expected 283 but was 282)

If so... you've got a match! If not, maybe my logcat command is wrong or you've got a similiar problem to mine that's not catched by my logcat ruleset. You can continue.

3.5. First... let's stop logcat logging by entering

adb shell killall -2 logcat

3.6. Go to Settings > User and Accounts > [email protected] > Sync now

Is it working / syncing again? Yey! It isn't working? Don't give up and continue!

4. How to force synchronize an Android Google Account over ADB

4.1. Our second try: Let's tell android to force sync especially your Google Account:

requestsync -F --account-name [email protected]

Note: Replace [email protected] with your Google Account address

4.2. Go to Settings > User and Accounts > [email protected] > Sync now

Is it working / syncing again? Yey! It isn't working? Don't give up and continue!

5. Delete Google Apps Data

5.1. line by line copy and enter a command to clear the Appdata of the following apps

adb shell pm clear com.google.android.gms
adb shell pm clear com.google.android.gsf
adb shell pm clear com.google.android.apps.photos
adb shell pm clear com.google.android.apps.maps
adb shell pm clear com.google.android.googlequicksearchbox

5.2. Reboot your device using

adb reboot

5.3. Go to Settings > User and Accounts > [email protected] > Sync now

Is it working / syncing again? Yey! It isn't working? Don't give up and continue...

... Here are some other Google apps you can try on your own risk (espacially if one of these app isn't syncing):

adb shell pm clear com.google.android.apps.nbu.files
adb shell pm clear com.google.android.apps.wellbeing
adb shell pm clear com.google.android.apps.googleassistant
adb shell pm clear com.google.android.calendar
adb shell pm clear com.google.android.contacts
adb shell pm clear com.google.android.gms.location.history
adb shell pm clear com.google.android.cellbroadcastservice
adb shell pm clear com.google.android.keep
adb shell pm clear com.google.android.permissioncontroller
adb shell pm clear com.google.android.setupwizard
adb shell pm clear com.google.android.ext.shared
adb shell pm clear com.google.android.gms.supervision
adb shell pm clear com.google.android.apps.tasks
adb shell pm clear com.google.android.apps.messaging
adb shell pm clear com.google.android.apps.walletnfcrel
adb shell pm clear com.google.android.overlay.gmsconfig.searchselector
adb shell pm clear com.google.android.permissioncontroller.overlay.oplus
adb shell pm clear com.google.android.apps.setupwizard.searchselector
adb shell pm clear com.google.android.modulemetadata
adb shell pm clear com.google.mainline.telemetry
adb shell pm clear com.google.android.apps.restore
adb shell pm clear com.google.android.overlay.gmsconfig.asi
adb shell pm clear com.google.android.apps.walletnfcrel
adb shell pm clear com.google.android.apps.subscriptions.red
adb shell pm clear com.google.android.apps.translate
adb shell pm clear com.google.android.feedback

Extras: Documentation

-> as there's nothing documented about the requestsync comand and its options:
adb shell requestsync --help

Usage:
requestsync [options]
With no options, a sync will be requested for all account and all sync
authorities with no extras.
Basic options:
-h|--help: Display this message
-n|--account-name <ACCOUNT-NAME>
-t|--account-type <ACCOUNT-TYPE>
-a|--authority <AUTHORITY>
App-standby related options
-f|--foreground (defeat app-standby job throttling, but not battery saver)
-F|--top (defeat app-standby job throttling and battery saver)
ContentResolver extra options:
--is|--ignore-settings: Add SYNC_EXTRAS_IGNORE_SETTINGS
--ib|--ignore-backoff: Add SYNC_EXTRAS_IGNORE_BACKOFF
--dd|--discard-deletions: Add SYNC_EXTRAS_DISCARD_LOCAL_DELETIONS
--nr|--no-retry: Add SYNC_EXTRAS_DO_NOT_RETRY
--ex|--expedited: Add SYNC_EXTRAS_EXPEDITED
-i|--initialize: Add SYNC_EXTRAS_INITIALIZE
--m|--manual: Add SYNC_EXTRAS_MANUAL
--od|--override-deletions: Add SYNC_EXTRAS_OVERRIDE_TOO_MANY_DELETIONS
-u|--upload-only: Add SYNC_EXTRAS_UPLOAD
--rc|--require-charging: Add SYNC_EXTRAS_REQUIRE_CHARGING
Custom extra options:
-e|--es|--extra-string <KEY> <VALUE>
--esn|--extra-string-null <KEY>
--ei|--extra-int <KEY> <VALUE>
--el|--extra-long <KEY> <VALUE>
--ef|--extra-float <KEY> <VALUE>
--ed|--extra-double <KEY> <VALUE>
--ez|--extra-bool <KEY> <VALUE>
requestsync add-periodic INTERVAL-SECOND [options]
requestsync remove-periodic [options]
Mandatory options:
-n|--account-name <ACCOUNT-NAME>
-t|--account-type <ACCOUNT-TYPE>
-a|--authority <AUTHORITY>
Also takes the above extra options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment