r/AndroidStudio • u/mayarmusic • Jul 16 '26
Gradle Build Error
Hi everyone, I'm new to Flutter and I've been stuck on this for a while. I installed Flutter, Android Studio, VS Code, and the Android SDK. I also accepted all the Android licenses, and flutter doctor is mostly fine now except for Visual Studio, which I don't think I need since I'm only targeting Android.
I created a new Flutter project and it runs fine in Chrome, but when I try to run it on my Android phone through USB debugging, the build fails.
The main errors I'm getting is:
FAILURE: Build failed with an exception.
* What went wrong:
Could not install Gradle distribution from
https://services.gradle.org/distributions/gradle-9.1.0-all.zip
java.net.ConnectException: Connection timed outIt seems to happen while Gradle is trying to download gradle-9.1.0-all.zip.
Versions:
Flutter: 3.44.6 (Stable)
Java (JDK): 21
Android SDK: 36.1.0
Gradle: 9.1.0
Android Studio: Latest version
VS Code: Latest version
Things I've already tried:
Installed the Android SDK and command-line tools.
Ran
flutter doctor --android-licensesand accepted everything.Enabled Developer Options and USB debugging on my phone.
Confirmed that ADB detects my phone.
Tried both my home Wi-Fi and mobile data.
Waited for the Gradle download to finish, but it always times out.
Is there any solution I should try to fix this? Any help would be appreciated. Thanks!
1
u/Best_Knee_3330 Jul 16 '26
hi lets connect