Fixing the "Antigravity server crashed unexpectedly. Please restart to fully restore AI features." on MacOS
Quick fix for the permission denied error blocking AI features in Antigravity IDE.
I recently set up the Antigravity IDE on my new MacBook Pro (M4) and immediately hit a wall. Upon launch, the AI engine refused to initialize, throwing this error loop:
“Antigravity server crashed unexpectedly. Please restart to fully restore AI features.”
Restarting didn’t help. Reinstalling didn’t help.
If you are stuck in this loop, don’t waste time reinstalling. The issue isn’t the software — it’s the filesystem permissions.
Here is the diagnosis and the fix.
The Diagnosis
I checked the IDE diagnostics file, and the root cause was immediately obvious. The logs were spamming this error:
codeBash
mkdir /Users/$username/.gemini/antigravity: permission deniedThe Antigravity language server attempts to write its configuration and state to ~/.gemini/antigravity. If the IDE cannot write to that folder, the engine crashes immediately.
Why does this happen?
This usually isn’t a bug in the IDE; it’s a macOS environment issue. Common culprits include:
- Sudo usage: You previously ran a script using sudo, causing the .gemini folder to be created with root ownership.
- Migration Assistant: Transferring data from an old Mac often carries over restrictive permission sets.
- macOS Sequoia/Sonoma: Sometimes the OS prevents apps from writing to hidden dot-directories without explicit prompts.
The Fix
You need to reclaim ownership of the directory and ensure your user has write access.
Open your Terminal and run the following commands:
1. Claim Ownership
Ensure your current user owns the .gemini directory recursively.
sudo chown -R $USER ~/.gemini2. Fix Read/Write Permissions
Grant yourself full read and write access.
chmod -R u+rw ~/.gemini3. (Optional) Create the directory if missing
If the folder didn’t exist yet (or the previous commands failed because of it), force create it with the correct permissions:
mkdir -p ~/.gemini/antigravity
chmod -R u+rw ~/.geminiVerification
To ensure the fix was successful, run this command to check the directory status:
codeBash
ls -ld ~/.gemini ~/.gemini/antigravityYou should see your username listed as the owner.
Once verified, restart Antigravity IDE. The language server should launch immediately without errors, restoring your AI autocompletion and agent tools.
Save yourself the debugging headache — always check your ~/.gemini permissions first.