[英]Gradle build can not resolve all Path_provider dependencies
I was able to add path_provider library to my pubspec.yaml file and I used its functionalities in my code. 我能够将path_provider库添加到我的pubspec.yaml文件中,并且在我的代码中使用了它的功能。 When I tried to flutter run, I got an gradle build error.
当我尝试扑动运行时,出现了gradle构建错误。
This is the error message: 这是错误消息:
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
My android/build.gradle 我的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
}
What I tried: 我试过的
Tried adding maven repository 尝试添加Maven存储库
buildscript { repositories { maven { url ' https://dl.google.com/dl/android/maven2 ' } jcenter() } buildscript {存储库{maven {url'https: //dl.google.com/dl/android/maven2 '} jcenter()}
I solved this issue by doing the following : 我通过以下操作解决了这个问题:
./gradlew dependencies
in project's android directory which downloaded missing path_provider dependencies. ./gradlew dependencies
,该命令下载了缺少的path_provider依赖项。 flutter clean
then flutter run
. flutter clean
然后flutter run
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.