Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter升级到1.17版本之后,编译时下载依赖报错的解决方案 #29

Closed
shichunlei opened this issue May 11, 2020 · 0 comments

Comments

@shichunlei
Copy link
Owner

shichunlei commented May 11, 2020

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-c9506cb8e93e5e8879152ff5c948b175abb5b997.
     Required by:
         project :app
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8
e93e5e8879152ff5c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8e93e5e
8879152ff5c948b175abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8
e93e5e8879152ff5c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8e93e5e
8879152ff5c948b175abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8
e93e5e8879152ff5c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/flutter_embedding_debug-1.0.0-c9506cb8e93e5e
8879152ff5c948b175abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
     Required by:
         project :app
      > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5
c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5
c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5
c948b175abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/arm64_v8a_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
   > Could not resolve io.flutter:x86_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.p
om'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:x86_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.p
om'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:x86_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.p
om'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
   > Could not resolve io.flutter:x86_64_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
     Required by:
         project :app
      > Could not resolve io.flutter:x86_64_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:x86_64_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
      > Could not resolve io.flutter:x86_64_debug:1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997.
         > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b1
75abb5b997.pom'.
            > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5b997/x86_64_debug-1.0.0-c9506cb8e93e5e8879152ff5c948b175abb5
b997.pom'.
               > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] 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 8m 31s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       512.5s (!)
Exception: Gradle task assembleDebug failed with exit code 1

报错代码:

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-c9506cb8e93e5e8879152ff5c948b175abb5b997.

解决办法:

修改:本地Flutter SDK安装路径下找到

flutter/packages/flutter_tools/gradle/resolve_dependencies.gradle

flutter/packages/flutter_tools/gradle/aar_init_script.gradle

flutter/packages/flutter_tools/gradle/flutter.gradle

3个文件中的 https://storage.googleapis.com/download.flutter.io   替换为:http://download.flutter.io   
然后重新编译就解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant