Flutter:https://flutter.cn/docs/get-started/install/windows
解决方式:
1 找到 flutter目录下 \flutter\packages\flutter_tools\lib\src\http_host_validator.dart
2 修改 const String kCloudHost = ‘https://storage.googleapis.com/’; 为 const String kCloudHost = ‘https://storage.flutter-io.cn’;
解决方式:
const String kMaven = ‘"https://maven.google.com’;
改为
const String kMaven = ‘http://maven.aliyun.com/nexus/content/groups/public/’;
解决方式
将镜像地址配置到系统环境变量中去
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven { url 'https://storage.googleapis.com/download.flutter.io' }
maven { url 'https://download.flutter.io' }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
// mavenLocal()
// mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven { url 'https://storage.googleapis.com/download.flutter.io' }
maven { url 'https://download.flutter.io' }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
// mavenLocal()
// mavenCentral()
}
}
修改为如下:
const String kCloudHost = 'https://storage.flutter-io.cn';
const String kCocoaPods = 'https://cocoapods.org/';
const String kGitHub = 'https://github.com/';
const String kMaven = 'http://maven.aliyun.com/nexus/content/groups/public/';
const String kPubDev = 'https://pub.dev/';
添加如下
添加如下
从GitHub下载DART库zip包,注意下载带版本号(tags)的压缩包,不要从master下载。
下载链接prefer:https://github.com/dartsim/dart