安卓真机运行flutter程序报错

报错信息:Exception in thread "main" java.net.SocketException: Unexpected end of file from server

at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:866)

at java.base/sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:689)

at java.base/sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2085)

at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:195)

at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1592)

at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)

at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:250)

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\


解决办法:

在项目目录中找到这个文件

将文件中的这个地址修改为其他的路径,运行一下,然后再恢复回来,重新运行刷新一下,相当于重新更新一下这个路径,问题就解决了

你可能感兴趣的:(安卓真机运行flutter程序报错)