Sonu Sahani logo
Sonusahani.com
How to fix Critical Bug and Persistent HTTP 400 Invalid Project Resource Name error in Antigravity?

How to fix Critical Bug and Persistent HTTP 400 Invalid Project Resource Name error in Antigravity?

0 views
5 min read
#Solutions

You’re getting a persistent HTTP 400 “Invalid Project Resource Name: projects/” and the app keeps calling projects/ with an empty name. Project selection UI is missing, so you can’t pick or provision a project and the request fails on every call. How to fix Critical Bug and Persistent HTTP 400 Invalid Project Resource Name error in Antigravity?

How to fix Critical Bug and Persistent HTTP 400 Invalid Project Resource Name error in Antigravity?

This issue appears when Antigravity’s local config and tokens don’t hold a valid Google Cloud project, so all API requests point to “projects/” (empty). Users reported trying: deleting .antigravity and %APPDATA%\Antigravity, setting GOOGLE_CLOUD_PROJECT, switching accounts to Gmail, and running antigravity auth login --force-project-sync, but the app still skips project assignment and fails with HTTP 400.

Solution Overview

AspectDetail
Root CauseMissing/empty project ID in Antigravity config and tokens; auto-provisioning or UI flow didn’t write a valid project to disk.
Primary FixFully reset Antigravity’s cache, ensure a valid Google Cloud project with billing is available, set project via env/config, then re-auth with forced project sync.
ComplexityMedium
Estimated Time15–30 minutes

How to fix Critical Bug and Persistent HTTP 400 Invalid Project Resource Name error in Antigravity?

Step-by-Step Solution

1) Remove stale Antigravity cache and config

  • Windows (PowerShell):
  • Close Antigravity completely.
  • Delete cache/config:
rmdir /S /Q "%APPDATA%\Antigravity"
rmdir /S /Q "%USERPROFILE%\.antigravity"
  • macOS:
rm -rf ~/Library/Application\ Support/Antigravity
rm -rf ~/.antigravity
  • Linux:
rm -rf ~/.config/Antigravity ~/.antigravity

2) Confirm you have a valid Google Cloud project with billing

  • List projects:
gcloud projects list
  • If you don’t see a suitable project, create one and link billing:
gcloud projects create YOUR_PROJECT_ID
gcloud beta billing projects link YOUR_PROJECT_ID --billing-account=YOUR_BILLING_ACCOUNT_ID

3) Set the project in environment (make it unambiguous)

  • Windows (Command Prompt):
setx GOOGLE_CLOUD_PROJECT YOUR_PROJECT_ID
setx GCLOUD_PROJECT YOUR_PROJECT_ID
setx CLOUDSDK_CORE_PROJECT YOUR_PROJECT_ID

Close and reopen your terminal after setx.

  • macOS/Linux (Bash/Zsh):
echo 'export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc
echo 'export GCLOUD_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc
echo 'export CLOUDSDK_CORE_PROJECT="YOUR_PROJECT_ID"' >> ~/.bashrc
source ~/.bashrc
  • Why: Some app builds read different variables; setting all three avoids the empty “projects/” name.

4) Re-authenticate and force a project sync

  • Run the exact command from the thread:
antigravity auth login --force-project-sync
  • If supported by your build, add verbosity for a trace:
antigravity auth login --force-project-sync --verbose

5) If the UI is still missing, set the project manually in the config file

  • After first relaunch (post-auth), create/edit the config:
  • Windows: %APPDATA%\Antigravity\config.json
  • macOS/Linux: ~/.antigravity/config.json
  • Put your project explicitly:
{
"project": "YOUR_PROJECT_ID"
}
  • Save, restart Antigravity, and test a request.

6) Validate Application Default Credentials (optional but effective)

  • Refresh ADC so the SDK can derive project_id from credentials:
gcloud auth application-default revoke
gcloud auth application-default login
  • Or point to a service account key that contains project_id:
  • Windows:
setx GOOGLE_APPLICATION_CREDENTIALS "C:\path\to\service-account.json"
  • macOS/Linux:
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/path/to/service-account.json"
  • Restart Antigravity and verify the error is gone.

7) Sanity check: Your account/plan and quotas

  • If you still get errors after fixing the project, confirm your plan and quotas are in good standing. For plan/account related blocks, see this quick helper: account not eligible troubleshooting.

Alternative Fixes & Workarounds

Force a fresh install of Antigravity

  • Uninstall, then reinstall the latest stable build.
  • Repeat Steps 1–4 after reinstall to guarantee a clean project entry.

Use project number instead of project ID

  • Some APIs accept numeric project number more reliably.
  • Replace YOUR_PROJECT_ID with your project number in env and config, then re-run:
gcloud projects describe YOUR_PROJECT_ID --format="value(projectNumber)"

Use that number everywhere and repeat Step 4.

Offline config bootstrap

  • If the app won’t launch the auth UI, bootstrap the config first:
  • Create ~/.antigravity/config.json (or %APPDATA%\Antigravity\config.json) with:
{
"project": "YOUR_PROJECT_ID",
"auth": { "source": "adc" }
}
  • Then run:
antigravity auth login --force-project-sync

Check for plan throttling or quotas

Troubleshooting Tips

  • Confirm the value actually loaded:
  • Windows (PowerShell):
[Environment]::GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT","Process")
[Environment]::GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT","User")
  • macOS/Linux:
echo $GOOGLE_CLOUD_PROJECT
  • Check you’re signed into the same Google account in both Antigravity and gcloud:
gcloud auth list
gcloud config list --format 'value(core.project)'
  • If your Trace ID is available (e.g., 0x494c0fc314fb783), re-run with --verbose and attach to support; it confirms server sees the project.
  • Proxies/VPN: ensure no header rewriting or TLS interception. A malformed Authorization header can cascade into 400s.
  • Billing active? Disabled billing can surface as generic client errors. Re-link if needed.
  • If you hit thinking/context caps after fixing 400s, this walk-through might help: resolving the 1024-tokens issue.

Best Practices

  • Always pin a default project at OS level: set GOOGLE_CLOUD_PROJECT (and GCLOUD_PROJECT) in your shell profile.
  • Keep a minimal config file with an explicit "project" key to avoid UI regressions breaking your setup.
  • Use ADC consistently; prefer gcloud auth application-default login on dev machines.
  • Maintain one active Google account context to avoid cross-account confusion in tokens and cached profiles.
  • Verify quotas and plan status before large runs to avoid mid-session errors; here’s a short primer: managing Antigravity quotas.

Final Thought

Once the project ID is written back into Antigravity’s config/tokens and you re-auth with a forced sync, the 400 “projects/” error clears immediately. Keep a stable default project via environment variables and a minimal config file to prevent future regressions.

Subscribe to our newsletter

Get the latest updates and articles directly in your inbox.

sonuai.dev

Sonu Sahani

AI Engineer & Full Stack Developer. Passionate about building AI-powered solutions.

Related Posts