当前位置:   article > 正文

Flutter 第一次运行,卡在Running Gradle task ‘assembleDegug‘,然后就提示错误的解决方案。_running gradle task 'assembledebug'...

running gradle task 'assembledebug'...
  1. Running Gradle task 'assembleDebug'...
  2. FAILURE: Build failed with an exception.
  3. * What went wrong:
  4. A problem occurred configuring root project 'android'.
  5. > Could not resolve all dependencies for configuration ':classpath'.
  6. > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven3(http://maven.aliyun.com/nexus/content/groups/public)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.5/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
  7. * Try:
  8. > Run with --stacktrace option to get the stack trace.
  9. > Run with --info or --debug option to get more log output.
  10. > Run with --scan to get full insights.
  11. * Get more help at https://help.gradle.org
  12. BUILD FAILED in 2s
  13. Running Gradle task 'assembleDebug'... 5.1s
  14. Exception: Gradle task assembleDebug failed with exit code 1

需要修改您的项目 :/{you Project}/android/gradle/build.gradle文件。如下图

  1. buildscript {
  2. ext.kotlin_version = '1.7.10'
  3. repositories {
  4. // google()
  5. // mavenCentral()
  6. maven { url 'https://maven.aliyun.com/repository/google' }
  7. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  8. maven {
  9. allowInsecureProtocol true
  10. url 'http://maven.aliyun.com/nexus/content/groups/public' }
  11. maven {
  12. allowInsecureProtocol true
  13. url "http://download.flutter.io" }
  14. }
  15. dependencies {
  16. classpath 'com.android.tools.build:gradle:7.3.0'
  17. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  18. }
  19. }
  20. allprojects {
  21. repositories {
  22. // google()
  23. // mavenCentral()
  24. maven { url 'https://maven.aliyun.com/repository/google' }
  25. maven { url 'https://maven.aliyun.com/repository/jcenter' }
  26. maven {
  27. allowInsecureProtocol true
  28. url 'http://maven.aliyun.com/nexus/content/groups/public' }
  29. maven {
  30. allowInsecureProtocol true
  31. url "http://download.flutter.io" }
  32. }
  33. }
  34. rootProject.buildDir = '../build'
  35. subprojects {
  36. project.buildDir = "${rootProject.buildDir}/${project.name}"
  37. }
  38. subprojects {
  39. project.evaluationDependsOn(':app')
  40. }
  41. tasks.register("clean", Delete) {
  42. delete rootProject.buildDir
  43. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/613588
推荐阅读
相关标签
  

闽ICP备14008679号