修改gradle镜像地址

路径: android/build.gradle,修改build.gradle文件

  1. buildscript {
  2. repositories {
  3. //google()
  4. //mavenCentral()
  5. maven{ url 'https://maven.aliyun.com/repository/google' }
  6. maven{ url 'https://maven.aliyun.com/repository/jcenter' }
  7. maven{ url 'http://maven.aliyun.com/nexus/content/groups/public'}
  8. }
  9. dependencies {
  10. classpath 'com.android.tools.build:gradle:4.1.0'
  11. }
  12. }
  13. allprojects {
  14. repositories {
  15. //google()
  16. //mavenCentral()
  17. maven{ url 'https://maven.aliyun.com/repository/google' }
  18. maven{ url 'https://maven.aliyun.com/repository/jcenter' }
  19. maven{ url 'http://maven.aliyun.com/nexus/content/groups/public'}
  20. }
  21. }
  22. rootProject.buildDir = '../build'
  23. subprojects {
  24. project.buildDir = "${rootProject.buildDir}/${project.name}"
  25. project.evaluationDependsOn(':app')
  26. }
  27. task clean(type: Delete) {
  28. delete rootProject.buildDir
  29. }

修改Flutter的Gradle运行地址

修改文件:android/gradlew.bat,因为默认是在C盘,会比较占用C盘的资源,所以更换一下运行环境地址

  1. set GRADLE_OPTS="-Dgradle.user.home=D:/home/document/gradle"

image.png
image.png