2020年12月24日星期四

Exception: Gradle task assembleDebug failed with exit code 1 when trying to run on android flutter

When I try to run on an android real device or simulator it gives this in flutter . It is just the basic flutter example app , Everything is ok on flutter doctor , and it fails when I try flutter doctor --android-license

Exception in thread "main" java.net.UnknownHostException: services.gradle.org  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)  at java.net.Socket.connect(Socket.java:607)  at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)  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:463)  at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)  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:1162)  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)  at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect  (AbstractDelegateHttpsURLConnection.java:177)  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream  (HttpsURLConnectionImpl.java:268)  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)  event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get"  in socialapp...}  event sent after app closed: {id: 0, progressId: null, finished: true}  Launching lib/main.dart on SM N960F in debug mode...  lib/main.dart:1  Exception in thread "main" java.net.UnknownHostException: services.gradle.org  Exception: Gradle task assembleDebug failed with exit code 1  
https://stackoverflow.com/questions/65444640/exception-gradle-task-assembledebug-failed-with-exit-code-1-when-trying-to-run December 25, 2020 at 10:02AM

没有评论:

发表评论