0

I suspect the proxy setting is not set correctly, or I might be wrong, please help me out here. I'm working under a corporate network and using a VPN.

Error details below:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "D:\flutter_workspace\flutter_app\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)


FAILURE: Build failed with an exception.

Finished with error: Please review your Gradle project setup in the android/ folder.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.2.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.2.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
               > Connect to dl.google.com:443 [dl.google.com/172.217.9.14] failed: Connection refused: connect

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
  Command: D:\flutter_workspace\flutter_app\android\gradlew.bat app:properties

2 Answers 2

1

Finally finally figured out what I was missing, I had to set the Proxy in gradle.properties file as directed in developers.android.com. For some reason, setting up the proxy in Android Studio alone didn't work.

Updated gradle.properties file:

org.gradle.jvmargs=-Xmx1536M
systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=80

PS: Thanks @Taio for your efforts. I appreciate them

Sign up to request clarification or add additional context in comments.

Comments

0

Check your internet connection and make sure it is stable. Gradle is trying to connect to the internet to get resources and is unable to. In this case I would suggest turning off the vpn and waiting for the build process to go on with a normal internet connection then after build you can continue using the vpn

5 Comments

I can download the files when I try to access them from the browser. Should I configure proxy for Git or something? Like I have already mentioned I'm running behind a corporate network with VPN
What IDE are you using
I'm using Android studio and the proxy setting is set to auto detect. I tried setting it manually as well but didn't work.
How did the error come up. Had you done a successful build before and had you been on this same network
You have never done a successful build of a flutter app while on the network?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.