【问题标题】:Gradle build can not resolve all Path_provider dependenciesGradle 构建无法解析所有 Path_provider 依赖项
【发布时间】:2020-01-07 08:01:15
【问题描述】:

我能够将 path_provider 库添加到 我的 pubspec.yaml 文件中,并在我的代码中使用了它的功能。 当我尝试 flutter run 时,我得到了一个 gradle build 错误。


这是错误信息:

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
}

我尝试了什么:

【问题讨论】:

    标签: android flutter android-gradle-plugin


    【解决方案1】:

    我通过执行以下操作解决了这个问题:

    1. 将 Gradle 升级到 5.4.1 版。
    2. 将 Gradle 插件版本升级到 3.5.0。
    3. 在项目的android中运行命令./gradlew dependencies 下载缺少的 path_provider 依赖项的目录。
    4. 运行flutter clean,然后运行flutter run

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-04
      • 2018-03-31
      • 2013-08-05
      • 2016-10-09
      • 1970-01-01
      • 2016-03-17
      • 1970-01-01
      • 2017-12-16
      相关资源
      最近更新 更多