被墙了导致无法运行项目,报错如下:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flutter_custom_dialog:javaPreCompileDebug'.
> Could not resolve all files for configuration ':flutter_custom_dialog:debugCompileClasspath'.
> Could not download flutter_embedding_debug.jar (io.flutter:flutter_embedding_debug:1.0.0-540786dd51f112885a89792d678296b95e6622e5)
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-540786dd51f112885a89792d678296b95e6622e5/flutter_embedding_debug-1.0.0-540786dd51f112885a89792d678296b95e6622e5.jar'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/flutter_embedding_debug/1.0.0-540786dd51f112885a89792d678296b95e6622e5/flutter_embedding_debug-1.0.0-540786dd51f112885a89792d678296b95e6622e5.jar'.
> Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.112] failed: Connection timed out: connect
* Try:
我的解决方法:
1.将Android目录下的build.gradle中的allprojects中添加一句
.........
allprojects {
repositories {
google()
jcenter()
maven {url 'https://dl.bintray.com/jetbrains/anko'}
}
}
...........
2.将fluttersdk安装目录下的flutter.gradle也加上这个
位置:\packages\flutter_tools\gradle\flutter.gradle
buildscript {
repositories {
google()
jcenter()
maven {url 'https://dl.bintray.com/jetbrains/anko'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}