flutter 运行项目,卡在:Running Gradle task 'assembleDebug'

解决方案:

1.修改项目中android/build.gradle文件

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
       //google()
         //jcenter()
         maven { url 'https://maven.aliyun.com/repository/google' }
         maven { url 'https://maven.aliyun.com/repository/jcenter' }
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
         maven {url 'http://download.flutter.io'}
    }

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

allprojects {
    repositories {
        //google()
         //jcenter()
         maven { url 'https://maven.aliyun.com/repository/google' }
         maven { url 'https://maven.aliyun.com/repository/jcenter' }
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
         maven {url 'http://download.flutter.io'}
    }
}
可以试着运行下看效果,如果还不行,继续修改

2.修改Flutter的配置文件, 该文件在Flutter安装目

该文件在 Flutter安装目录/packages/flutter_tools/gradle/flutter.gradle

buildscript {
    repositories {
               //google()
         //jcenter()
         maven { url 'https://maven.aliyun.com/repository/google' }
         maven { url 'https://maven.aliyun.com/repository/jcenter' }
         maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
 
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}
分类: Flutter 标签: flutterGradle

评论

暂无评论数据

暂无评论数据

目录