One of the more frustrating issues Android developers encounter in Android Studio is a network-related build failure that appears as: “Connect to 169.254.1.1:10809 failed: Connection timed out.” This error usually prevents Gradle from syncing dependencies, building projects, or downloading required libraries. At its core, this problem is not caused by your code but by a misconfigured proxy setting inside the Gradle or system environment.
By following this guide, you will learn how to identify and remove incorrect proxy configurations so that Android Studio can successfully connect to the internet again. Once fixed, your Gradle sync will work normally, builds will complete without interruption, and dependency downloads will resume.
Before starting, ensure you have access to your Android Studio installation directory and permission to edit configuration files such as gradle.properties. No additional software is required.
Why This Issue Happens / Use Cases
This error occurs when Gradle or Android Studio is forced to route internet traffic through a proxy server that does not exist or is unreachable. In many cases, the system automatically inherits proxy settings from VPN software, corporate networks, or previously configured development environments. The IP address 169.254.1.1 is a link-local address, meaning it is not a valid external proxy server and cannot route traffic to the internet.
When Gradle tries to download dependencies from repositories like Google Maven or Maven Central, it mistakenly sends requests through this invalid proxy at port 10809. The result is a timeout error because no service is actually listening on that address.
Fixing this issue is important because it restores normal build functionality. Developers often encounter it when switching networks, disabling VPNs, or moving projects between machines. Resolving proxy misconfiguration improves build reliability, speeds up dependency resolution, and ensures smoother development workflows.
Step-by-Step Walkthrough: Method 1 (Primary Way)
The most effective way to fix this issue is by editing the gradle.properties file and removing incorrect proxy settings.
-
Locate the Gradle Properties File
Open your Android Studio installation directory or project root folder. Look for a file namedgradle.properties. In some cases, it may exist in both the project directory and the global Gradle directory.
[Screenshot: Locating gradle.properties in project structure] -
Open the File for Editing
Use any text editor or Android Studio itself to open the file. Ensure you have write permissions before making changes. -
Identify Proxy Configuration Lines
Search for entries similar to:systemProp.http.proxyHost=169.254.1.1 systemProp.https.proxyHost=169.254.1.1 systemProp.http.proxyPort=10809 systemProp.https.proxyPort=10809These lines instruct Gradle to route all traffic through an invalid proxy server. -
Remove or Comment Out the Lines
You can either delete them completely or comment them out using#:# systemProp.http.proxyHost=169.254.1.1 # systemProp.https.proxyHost=169.254.1.1 # systemProp.http.proxyPort=10809 # systemProp.https.proxyPort=10809 -
Sync Gradle Again
Return to Android Studio and click “Sync Project with Gradle Files.” This forces Gradle to reconnect without the broken proxy settings.
[Screenshot: Gradle sync button in Android Studio] -
Restart Android Studio (Optional but Recommended)
Restarting ensures all cached network settings are cleared and the IDE reloads the corrected configuration.
After completing these steps, the timeout error should disappear, and dependency downloads should resume normally.
Alternative Method: Method 2 (Secondary/Faster Way)
If editing gradle.properties does not resolve the issue, the problem may also be stored in Android Studio’s internal proxy settings.
To fix it quickly:
- Open Android Studio Settings (or Preferences on macOS).
- Navigate to Appearance & Behavior → System Settings → HTTP Proxy.
- Select “No Proxy” or “Auto-detect proxy settings.”
- Apply changes and restart the IDE.
This method is often faster because it bypasses file-level configuration and directly resets IDE network behavior. It is especially useful if multiple projects are affected or if you are unsure where the proxy settings were originally defined.
In cases where developers frequently switch environments, using consistent proxy management tools or centralized configuration can prevent recurrence of this issue.
Common Errors & Troubleshooting FAQ
One common mistake is editing the wrong gradle.properties file. Android Studio may use both a global and project-level configuration, so changes in one file might not take effect if the other still contains proxy settings.
Another issue occurs when corporate VPN software automatically re-injects proxy settings after reboot. In such cases, the configuration must be disabled both in the VPN client and system network settings.
Some users also forget to sync Gradle after making changes, which results in the error persisting even though the configuration is correct. Always re-sync or restart Android Studio after modifications.
If the problem still persists, clearing the Gradle cache (.gradle folder) can help force a fresh dependency download.
Summary & Best Practices
Removing invalid proxy settings from gradle.properties or Android Studio’s HTTP proxy configuration resolves most “169.254.1.1:10809 connection timed out” errors and restores normal Gradle functionality.
Always ensure proxy settings match your actual network environment and avoid leaving outdated configurations behind when switching networks or disabling VPNs.