一直卡在building a flutter app for general distribution;
AS Message窗口显示 依赖下载失败:
1、修改仓库地址的配置:android/build.gradle
repositories {
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' }
// maven { url "https://maven.aliyun.com/repository" }
mavenLocal()
mavenCentral()
// google()
// jcenter()
// gradlePluginPortal()
// maven { url 'https://repo1.maven.org/maven2/' }
// maven { url 'https://jitpack.io' }
}
2、因为setting.gradle中有这个配置:
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
所以还要去修改flutter-tools中的配置:
...\FlutterSdk\flutter_windows_3.0.5\packages\flutter_tools\gradle\flutter.gradle
repositories {
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' }
google()
mavenCentral()
}