- flutter 相关问题
- AndroidStudio运行Flutter项目卡在Runnin
- 解决flutter环境配置问题引起的执行flutter run卡
- Flutter运行卡在Running Gradle task '
- Flutter编译报错: Failed to find Buil
- flutter 一直卡在Running Gradle task
- [flutter] Running Gradle task 'a
- flutter 卡 Running Gradle task 'a
- flutter Running Gradle task 'ass
- flutter 解决 Running Gradle task ”
1、问题:用安卓模拟器打开flutter项目时候,一直卡在Running Gradle task 'assembleDebug'...
2、原因:这是因为android studio运行项目时需要请求部分资源,而请求外网资源,你懂的...
3、解决:解决方法:1、翻*墙 。2换源
- flutter\packages\flutter_tools\gradle/flutter.gradle
repositories {
// google()
// mavenCentral()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
}
class FlutterPlugin implements Plugin<Project> {
// private static final String DEFAULT_MAVEN_HOST = "https://storage.googleapis.com";
private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn";
...}
- flutter\packages\flutter_tools\gradle/resolve_dependencies.gradle
repositories {
// google()
// mavenCentral()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
maven {
// url "$storageUrl/download.flutter.io"
url "https://storage.flutter-io.cn/download.flutter.io"
}
}
- 项目中的android\build.gradle
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
// google()
// mavenCentral()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
}
...
allprojects {
repositories {
// google()
// mavenCentral()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
}
}
网友评论