当前位置:   article > 正文

flutter开发中一直Running Gradle task ‘assembleDebug‘...的解决办法_flutter running gradle task 'assembledebug'...

flutter running gradle task 'assembledebug'...

进入到项目的android里的build.gradle中修改配置:

 google()
 mavenCentral()
  • 1
  • 2

改为:

     maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven {
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/nexus/content/groups/public'
        }
        google()
        mavenCentral()

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

这样的修改有二处。allprojects里的repositories也进行相应的修改:

     maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven {
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/nexus/content/groups/public'
        }
        google()
        mavenCentral()

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

这里是我的整个配置:

buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {

        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven {
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/nexus/content/groups/public'
        }
        google()
        mavenCentral()

    }

    dependencies {
       classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
       // classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven {
            allowInsecureProtocol = true
            url 'https://maven.aliyun.com/nexus/content/groups/public'
        }
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

在android/gradle/wrapper中的gradle-wrapper.properties进行修改:distributionUrl改为tencent的

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-8.0-bin.zip
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/718191
推荐阅读
相关标签
  

闽ICP备14008679号