Android Gradle生成无法解析所有路径\提供程序依赖项

Android Gradle生成无法解析所有路径\提供程序依赖项,android,flutter,android-gradle-plugin,Android,Flutter,Android Gradle Plugin,我能够将path\u provider库添加到我的pubspec.yaml文件中,并在代码中使用了它的功能。 当我试着飞跑时,我得到了一个渐变构建错误 这是错误消息: FAILURE: Build failed with an exception. * What went wrong: Could not resolve

我能够将path\u provider库添加到我的pubspec.yaml文件中,并在代码中使用了它的功能。 当我试着飞跑时,我得到了一个渐变构建错误


这是错误消息:

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Could not resolve all files for configuration ':path_provider:lintClassPath'.
> Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.3.0/intellij-core-26.3.0.jar
> Could not find kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.3.0/kotlin-compiler-26.3.0.jar
> Could not find uast.jar (com.android.tools.external.org-jetbrains:uast:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.3.0/uast-26.3.0.jar
我的android/build.gradle

buildscript {
repositories {
    google()
    jcenter()
}

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
我的尝试:

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Could not resolve all files for configuration ':path_provider:lintClassPath'.
> Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.3.0/intellij-core-26.3.0.jar
> Could not find kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.3.0/kotlin-compiler-26.3.0.jar
> Could not find uast.jar (com.android.tools.external.org-jetbrains:uast:26.3.0).
  Searched in the following locations:                                  
      https://dl.google.com/dl/android/maven2/com/android/tools/external/org-jetbrains/uast/26.3.0/uast-26.3.0.jar
  • 尝试降级和升级gradle插件
  • 尝试添加maven存储库

    构建脚本{ 存储库{ 马文{ url“” } jcenter() }


我通过以下操作解决了此问题:

  • 将Gradle升级到5.4.1版
  • 将Gradle插件版本升级到3.5.0
  • 在项目的android中运行命令
    /gradlew dependencies
    下载缺少路径\u提供程序依赖项的目录
  • 运行
    flatter clean
    然后
    flatter Run