Gradle build can not resolve all Path_provider dependencies
640
I solved this issue by doing the following :
- Upgrading Gradle to version 5.4.1 .
- Upgrading Gradle plugin version to 3.5.0 .
- Run the command
./gradlew dependencies
in project's android directory which downloaded missing path_provider dependencies. - Run
flutter clean
thenflutter run
.
Author by
Sameer Ahmad
Updated on December 13, 2022Comments
-
Sameer Ahmad over 1 year
I was able to add path_provider library to my pubspec.yaml file and I used its functionalities in my code. When I tried to flutter run, I got an gradle build error.
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
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 downgrading and upgrading gradle plugin.
-
Tried adding maven repository
buildscript { repositories { maven { url 'https://dl.google.com/dl/android/maven2' } jcenter() }