小白求教,flutter的配置出了问题

#1

这里一直提示得不到pom文件,换成阿里云的国内地址也不行。。。。
但是我直接运行flutter里的 android 是可以运行的 Snipaste_2019-05-11_02-28-54
直接启动flutter一直报如下错误

 * Error running Gradle:
    ProcessException: Process "G:\SourceCode\AndroidFile\flutter_app\android\gradlew.bat" exited abnormally:

    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 'http://maven.aliyun.com/nexus/content/repositories/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
                > Could not GET 'http://maven.aliyun.com/nexus/content/repositories/jcenter/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect
          > 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 GET 'http://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect
          > Could not resolve com.android.tools.build:gradle:3.2.1.
             > Could not get resource 'http://mirrors.163.com/maven/repository/maven-public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
                > Could not GET 'http://mirrors.163.com/maven/repository/maven-public/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect
       > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71.
         Required by:
             project :
          > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71.
             > Could not get resource 'http://maven.aliyun.com/nexus/content/repositories/jcenter/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                > Could not GET 'http://maven.aliyun.com/nexus/content/repositories/jcenter/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect
          > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71.
             > Could not get resource 'http://maven.aliyun.com/nexus/content/groups/public/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                > Could not GET 'http://maven.aliyun.com/nexus/content/groups/public/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect
          > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71.
             > Could not get resource 'http://mirrors.163.com/maven/repository/maven-public/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                > Could not GET 'http://mirrors.163.com/maven/repository/maven-public/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.pom'.
                   > Connect to mirrors.dormforce.net:80 [mirrors.dormforce.net/202.115.22.208] failed: Connection timed out: connect

    * 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.org

    BUILD FAILED in 1m 8s
      Command: G:\SourceCode\AndroidFile\flutter_app\android\gradlew.bat app:properties

    Finished with error: Please review your Gradle project setup in the android/ folder.
#2

mirrors.dormforce.net 应该是代理服务器吧,你是不是设置了代理或者修改了host文件

#3

感谢提醒! 以前在gradle的全局配置里的代理服务器没有改,注释掉后已经没有问题了。:blush:

#4

我在构建 Android apk时候遇到了相同的问题,请问你是怎么解决的?