shichunlei / flutter_app

🔥🔥🔥本项目包括各种基本控件使用(Text、TextField、Icon、Image、Listview、Gridview、Picker、Stepper、Dialog、Slider、Row、Appbar、Sizebox、BottomSheet、Chip、Dismissible、FlutterLogo、Check、Switch、TabBar、BottomNavigationBar、Sliver等)、豆瓣电影、tubitv、每日一文、和天气、百姓生活、随机诗词、联系人、句子迷、好奇心日报、有道精品课、高德定位、音乐播放器🎵、追书神器等板块

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

shichunlei opened this issue · comments

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   
然后重新编译就解决了