problem whit Gradle in Flutter android studio 3.2 working behind a proxy

I'm working behind a proxy and i have this problem when i run muy flutter app in android studio 3.2

Launching lib\main.dart on LGMS323 in debug mode...
Initializing gradle...
Finished with error: Exit code 1 from: D:\Android\Flutter\Mis_Proyectos\flutter_app\android\gradlew.bat -v:
Downloading https://services.gradle.org/distributions/gradle-4.4-all.zip   

Exception in thread "main" java.net.UnknownHostException: services.gradle.org
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:673)
    at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
    at org.gradle.wrapper.Download.download(Download.java:44)
    at org.gradle.wrapper.Install$1.call(Install.java:61)
    at org.gradle.wrapper.Install$1.call(Install.java:48)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    at org.gradle.wrapper.Install.createDist(Install.java:48)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

And when I change in android/gradle/wraper/gradle-graper.properitis:

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

for

distributionUrl=D:\Android\Gradle/gradle-4.6-all.zip

this happens:

Launching lib\main.dart on LGMS323 in debug mode...
Initializing gradle...
Finished with error: Exit code 1 from: D:\Android\Flutter\Mis_Proyectos\flutter_app22222222\android\gradlew.bat -v:
Exception in thread "main" java.lang.NullPointerException
    at org.gradle.wrapper.PathAssembler.getDistName(PathAssembler.java:84)
    at org.gradle.wrapper.PathAssembler.getDistribution(PathAssembler.java:40)
    at org.gradle.wrapper.Install.createDist(Install.java:44)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

Try changing android/gradle/wrapper/graddle-wrapper.properties from

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

to

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

or alternatively

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

Known issues with Android Studio and Android Gradle Plugin, I'm working behind a proxy and i have this problem when i run muy flutter app in android studio 3.2. Launching libmain.dart on LGMS323 in  Im new to flutter and android studio as well.. Now my problem is, Say if I'm gonna open a ' New Flutter project ', The project opens successfully. but when I go to 'build.gradle' in app directory, It shows 2 errors.

Try with a file protocol URL for pointing to local file. Like this -

distributionUrl=file:///D:/Android/Gradle/gradle-4.6-all.zip

Although, you might face further proxy blockages (with dl.google.com etc.) if your company has any.

I am unable to create a new app on flutter · Issue #25270 · flutter , This page tracks known issues with Android Studio 4.0 and Android Gradle plugin 4.0. To work around this issue, just restart Studio once you've upgraded and before you begin using the IDE. If you're behind a proxy, try to connect directly. Thanks for looking into this. As per suggestion, yes I did use flutter make-host-app-editable, and it works.On a note, the project build.gradle of the generated android folder is still not editable, given that not much configuration is needed for that (except when updating the android gradle plugin to 3.3.x, etc.), this works fine for now.

Sometime problem in the local.properties file under android. like path of sdk is not properly declare so you must check it and if any error it show automatically.

Installing Flutter on Windows causes Gradle error · Issue #25189 , I have Android studio as well as flutter installed on my system When I run GitHub is home to over 50 million developers working together to Android Studio (version 3.2) • Android Studio at C:\Program But i'm facing gradle error while running the app. Did you create the app with the proxy enabled? can anyone help me I'm running android studio 3.1 in windows 10 and I'm using Flutter, the thing is I'm having a problem with the gradle , the program couldn't download it i have tried to reinstall the program to many times and tried to download the gradle so many times when i press run in android studio it always stuck in initializing gradle

Flutter application build issue - flutter, Launching lib\main.dart on Android SDK built for x86 in debug mode Initializing gradle Finished with error: ProcessException: Process GitHub is home to over 50 million developers working together to host and Android Studio (​version 3.2) • Android Studio at C:\Program Are you behind a proxy? Everytime opening a Flutter project, no matter what I have tried, I will have to do either or multiple of the following things: Reassign the Flutter SDK path: Enable Dart support for the project: Sync project with Gradle Files.

001. How to fix Unknown host 'services.gradle.org' in Android Studio , Launching lib\main.dart on Android SDK built for arm64 in debug mode. exited abnormally: Starting a Gradle Daemon, 1 incompatible Daemon could not be Required by: project : Could not resolve com.android.tools.build:gradle:3.2.1. Finished with error: Please review your Gradle project setup in the android/ folder​. In the last few days Flutter stable has been updated to 1.9.x, and Gradle plugin was updated to version 3.5 last month.. While some aspects of the boilerplate have been updated with Flutter 1.9.x (e.g., defaulting to Swift and Kotlin), the Gradle plugin has remained at 3.2.1.

How to resolve 407 Proxy issue? - Buildship, Received status code 407 from server: Proxy Authentication Required i have updated i have updated the properties files with proxyname,port , username and gradle behind proxy in Android Studio 1.3 And I confirm, it DOES NOT work. Could not find com.android.tools.build:gradle:2.2.2 2.3.2 for the proxy I'm stuck behind. Android Studio + Gradle did not assume system proxy settings, at least

Comments
  • "java.net.UnknownHostException: services.gradle.org" : it looks like you have some network issue: did you try to download the zip distribution directly from a web browser with services.gradle.org/distributions/gradle-4.4-all.zip ?
  • Yes, I have gradle downloaded. I'm also working behind a proxy. but I do not know how to configure the gradle
  • does it need to download gradle for each app i create, if so then why?
  • Different apps can depend on different Gradle versions. I don't remember more details. I have no good Gradle knowledge and it's a while I had to deal with that.
  • This is more of a comment giving a general suggestion than a full answer. Take a look again at How to Answer