Windows Auth Loop: "Failed to exchange authorization code for token"

When I click “Sign in with Google,” the browser authenticates successfully and redirects properly, but when it hands the authorization code back to the IDE, it immediately throws this error:

“There was an unexpected issue setting up your account. Failed to exchange authorization code for token.”

My Setup:

  • OS: Windows 10 (Build 10.0.26200.7840)

  • App: Google Antigravity

What I’ve already tried (none of this worked):

  1. Forcing a Windows system clock sync to fix potential OAuth timestamp mismatches.

  2. Completely deleting the %appdata%\Antigravity folder to clear the local token vault/cache.

  3. Triggering the deep link manually via CLI (Antigravity.exe --open-url "antigravity://auth").

  4. Running the auth flow through an Incognito browser window to rule out extension interference.

Has anyone found a functional workaround for this, or is the auth server just dropping requests right now? I’ll attach my screenshots below.

2 Likes

Facing the same issue
Tried all of the above options too
It was working fine until yesterday.
Today i tried installing the update it wasn’t happening so i had to delete the data ,refreshed the cache and cookies and tried downloading with the same account along with the authentication with the same account its throwing this screen:

Please help in resolving this issue

Same problem with Ubuntu

Hey All,

This error indicates that while your browser can reach Google, but the Antigravity itself is being blocked from making the final connection to Google’s servers. This is usually caused by a Proxy or Antivirus intercepting the network traffic.

Please try running the application from a terminal with proxy variables cleared:
set HTTP_PROXY=
set HTTPS_PROXY=
start Antigravity.exe

If that fails, check if your Antivirus has ‘HTTPS Scanning’ enabled and whitelist the Antigravity executable.

1 Like

Yes, It is a critical error. can anybody help with that.

1 Like

I use clash and also face this problem ,and i just update my proxy application,谷歌 Antigravity 登录不了怎么办,三个常见问题解决

this url help me a lot ,now I can use antigravity again.

1 Like
I tried it worked

Following chunduriv’s suggestion below,

using `set HTTP_PROXY=` (clear proxy) in the command line might cause the software to fail to connect to Google servers during the “get token” step due to the lack of a proxy.

Find your VPN port: Check your VPN software’s (such as Clash, v2rayN) settings for the HTTP proxy port (usually 7890 or 10809).

Set the proxy in CMD and restart:

`set HTTP_PROXY=http://127.0.0.1:your port number`

`set HTTPS_PROXY=http://127.0.0.1:your port number`

`start Antigravity.exe`

Log in again: This will allow the software to use the VPN tunnel to get the token.

4 Likes

I tried this method, and it works for temporarily routing the software’s traffic through the proxy. However, since I don’t want to launch it via CMD every time, it’s much more convenient to just set the proxy software to ‘TUN Mode’.

Thanks a lot! Your suggestion worked perfectly and solved my problem.

I meet this problem today. And I found it solved by changing my network from WIFI to 5G network. It works out immediately, perhaps there is something wrong with my WIFI setting.
Hope it would be helpful for someone in need.