skip to Main Content

I’m trying to learn Flutter and trying to initialize first app.

I’ve applied all steps in Flutter getting started page but still getting exception like

Launching libmain.dart on sdk gphone64 x86 64 in debug mode...
main.dart:1
Exception in thread "main" java.net.ConnectException: Connection timed out: connect
    at java.base/sun.nio.ch.Net.connect0(Native Method)
    at java.base/sun.nio.ch.Net.connect(Net.java:579)
    at java.base/sun.nio.ch.Net.connect(Net.java:568)
    at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
    at java.base/java.net.Socket.connect(Socket.java:633)
    at java.base/java.net.Socket.connect(Socket.java:583)
    at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:531)
    at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:590)
    at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:588)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
    at java.base/sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:587)
    at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:631)
    at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:266)
    at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
    at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:202)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1263)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
    at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1665)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
    at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
    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)
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

flutter doctor -v

SDK Platforms
SDK Tools

VS Code

I’ve tried both standard emulator and cold boot emulator, nothing changed.
I’ve tried both VS Code and

flutter run 

to initialize but nothing changed.
I’ve tried older versions of Android Studio and Pixel 6 Emulator but I got still same issue.

Thanks in advance.

I’ve tried both standard emulator and cold boot emulator, nothing changed.
I’ve tried both VS Code and flutter run to initialize but nothing changed.
I’ve tried older versions of Android Studio and Pixel 6 Emulators but I got still same issue.

2

Answers


  1. Chosen as BEST ANSWER

    Thanks for your quick response.

    SDK version change is not worked, I've found the root cause that there were unnecessary proxy settings in .gradlegradle.properties file. When I delete that proxy settings application is started.


  2. Go to your androidappbuild.gradle file and try updated this

    compileSdkVersion 29
    targetSdkVersion 29
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search