Flutter 版本 1.22 问题解决 Could not resolve io.flutter:flutter_embedding_debug

报错内容:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve io.flutter:flutter_embedding_debug:1.0.0-ee76268252c22f5c11e82a7b87423ca3982e51a7.
     Required by:
         project :app
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
   > Could not resolve io.flutter:arm64_v8a_debug:1.0.0-ee76268252c22f5c11e82a7b87423ca3982e51a7.
     Required by:
         project :app
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
   > Could not resolve io.flutter:x86_debug:1.0.0-ee76268252c22f5c11e82a7b87423ca3982e51a7.
     Required by:
         project :app
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
   > Could not resolve io.flutter:x86_64_debug:1.0.0-ee76268252c22f5c11e82a7b87423ca3982e51a7.
     Required by:
         project :app
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 40s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       162.2s (!)
Exception: Gradle task assembleDebug failed with exit code 1

解决方法: 添加 maven { url “http://download.flutter.io”}

以下是完整的

buildscript {
    repositories {
        google()
        jcenter()
        maven { url "http://download.flutter.io"}
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "http://download.flutter.io"}
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

你可能感兴趣的:(Flutter)