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() }