1、Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)
控制台显示如下报错信息:
Launching lib/main.dart on sdk gphone x86 arm in debug mode...Running Gradle task 'assembleDebug'...FAILURE: Build failed with an exception.* 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://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Could not HEAD 'https://maven.aliyun.com/repository/google/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)> Could not resolve com.android.tools.build:gradle:3.2.1.> Could not get resource 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Could not HEAD 'https://maven.aliyun.com/repository/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)> Could not resolve com.android.tools.build:gradle:3.2.1.> Could not get resource 'http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Could not HEAD 'http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.> Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)* 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.orgBUILD FAILED in 9sException: Gradle task assembleDebug failed with exit code 1
需要删除项目根目录 gradle.properties 内的代理配置
systemProp.https.proxyPort=1080systemProp.http.proxyHost=127.0.0.1systemProp.https.proxyHost=127.0.0.1systemProp.http.proxyPort=1080
如果还没解决,需要我们去删除全局配置里代理配置
Windows
C:\Users\Administrator.gradle\gradle.properties
Mac
open /Users/你的用户目录/.gradle/gradle.properties
