由于某些原因,flutter android打包往往会很慢,而且容易失败
只需要将android下面的build.gradle 段时的 repositories maven源替换成国内镜像即可。
buildscript {
ext.kotlin_version = '1.5.20'
repositories {
// google()
// mavenCentral()
maven{ url 'https://maven.aliyun.com/repository/central' }
maven{ url 'https://maven.aliyun.com/repository/public' }
maven{ url 'https://maven.aliyun.com/repository/google' }
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven{ url 'https://maven.aliyun.com/repository/central' }
maven{ url 'https://maven.aliyun.com/repository/public' }
maven{ url 'https://maven.aliyun.com/repository/google' }
maven{ url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
}