Flutter warning: path_provider_linux-0.0.1+1\android does not exist

Viewed 1267

Running a Flutter project and after upgrading Android Studio to version 4.0 I get the following warning when opening the Android module in Android Studio:

Warning: root project 'android': Unable to resolve additional project configuration.
Details: org.apache.tools.ant.BuildException: Basedir C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-0.0.1+1\android does not exist.

I can see that now this android directory does indeed not exist. On the project screen, it says: Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly. I have tried to reinstall both Android Studio and Flutter, but it doesn't help.

How can this problem be solved?

2 Answers

In the pubspec.yaml file under dependencies use:

path_provider: ^1.6.5

Dont use latest one

In build.gradle make sure classpath is as follow:

 classpath 'com.android.tools.build:gradle:3.6.3'

In gradle-wrapper.properties file makes sure this is the distribtion URL:

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

Make sure in all the gradle files the latest version are there.Android studio only will help that and try again

Related