gpt4 book ai didi

android - Gradle 构建无法解析所有 Path_provider 依赖项

转载 作者:行者123 更新时间:2023-11-30 05:03:33 28 4
gpt4 key购买 nike

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


这是错误信息:

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
}

我尝试了什么:

最佳答案

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

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

关于android - Gradle 构建无法解析所有 Path_provider 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57788170/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com