【问题标题】:Flutter not building for version 1.10 or higherFlutter 不适用于 1.10 或更高版本
【发布时间】:2020-04-08 11:47:55
【问题描述】:

最近我将我的颤振版本更新到最新版本,然后我收到以下错误:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Warning: Failed to parse host [PROXY SERVER] systemProp.http.proxyPort=[PROXY PORT]
Warning: Failed to parse host [PROXY SERVER] systemProp.http.proxyPort=[PROXY PORT]

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/flutter_embedding_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
   > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:x86_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
   > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks
      > Could not resolve io.flutter:x86_64_debug:1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.
         > Could not get resource 'http://download.flutter.io/io/flutter/x86_64_debug/1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695/x86_64_debug-1.0.0-2994f7e1e682039464cb25e31a78b86a3c59b695.pom'.
            > Host name may not contain blanks

* 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 5s
Finished with error: Gradle task assembleDebug failed with exit code 1

当我创建一个新项目时,它也会产生这个错误。我尝试了不同版本的颤振和 1.9.7 版本。更高版本会产生所有相同的错误。 好像是gradle的问题。使用 gradle 3.2.1 一切正常。

【问题讨论】:

    标签: android gradle flutter android-gradle-plugin


    【解决方案1】:

    我认为这与前 5 行警告中所示的代理配置有关。

    在 gradle.properties 中查看您的代理配置

    【讨论】:

    • 我没有使用任何代理,也没有在 gradle.properties 中配置任何代理设置。
    • @RaphaelThurnherr 你检查过项目的android文件夹里面的gradle.properties和用户目录里面的gradle.properties吗? (在 Windows 中是 C:\Users\\.gradle\gradle.properties)
    • 是的,这就是问题所在。太感谢了。我浪费了这么多时间,不知道用户目录中还有其他 gradle.properties 。在 Linux 中是 ~/.gradle。
    • @RaphaelThurnherr 欢迎您,当您为所有项目使用相同的代理配置时,用户目录中的 gradle.properties 会派上用场。
    【解决方案2】:

    您应该使用AndroidStudio 打开您的项目并打开gradle.properties

    并清除您的proxy

    这个方法对我有用

    如果你的国家像对伊朗的制裁,请使用 vpn

    【讨论】:

      猜你喜欢
      • 2020-02-09
      • 1970-01-01
      • 2016-12-17
      • 1970-01-01
      • 1970-01-01
      • 2018-07-04
      • 2020-08-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多