flutter项目编译问题汇总

1、kotlin compiler embeddable下载慢的解决办法

备注:可以使用https://developer.aliyun.com/mvn/search这个链接搜索并下载

2、运行Flutter项目一直卡在--Running Gradle task 'assembleDebug'

解决方法:

第一步:修改flutter安装目录/packages/flutter_tools/gradle文件夹中的两个文件flutter.gradle、resolve_dependencies.gradle,修改内容如下图

flutter项目编译问题汇总_第1张图片

flutter项目编译问题汇总_第2张图片

flutter项目编译问题汇总_第3张图片

private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn";

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/public' } 

String storageUrl = System.getenv('FLUTTER_STORAGE_BASE_URL') ?: "https://storage.flutter-io.cn"

第二步:修改项目中Android的gradle配置,android\build.gradle,将

google() 

jcenter()

改成

maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/public' } 

备注:https://developer.aliyun.com/mvn/guide 阿里云仓库服务

3、flutter 旧有V1项目升级V2

https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

Supporting the new Android plugins APIs | Flutter

你可能感兴趣的:(flutter,flutter,android,android,studio)