当前位置:   article > 正文

Running Gradle task “assembleDebug“卡住问题_running gradle task 'assembledebug'... 卡主

running gradle task 'assembledebug'... 卡主

原因:Gradle的Maven仓库在国外
解决方案:设置淘宝镜像

1、修改flutter项目,android目录下的build.gradle
buildscript {
    ext.kotlin_version = '1.3.50'
    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' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}
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' }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
2、修改flutter安装目录下在的flutter.gradle

文件位置:flutter安装路径\flutter\packages\flutter_tools\gradle\flutter.gradle

buildscript {
    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' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}
private static final String DEFAULT_MAVEN_HOST = "https://storage.googleapis.com";
//修改为
private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn";
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/718183
推荐阅读
相关标签
  

闽ICP备14008679号