2

I'm encountering an error when building my Flutter project, and I have been unable to resolve it after trying various solutions. Here is the error message I am getting:

The supplied phased action failed with an exception.

Could not create task ':path_provider_android:compileDebugUnitTestSources'.
this and base files have different roots: D:\\Sem-8\\Projects\\chat\\build\\path_provider_android and C:\\Users\\haris\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.15\\android.

Context:
Flutter Version: (e.g., Flutter 3.0.5)
Android Studio Version: (e.g., 2021.3)
Operating System: Windows 10
Path Provider Version: 2.2.15

Cleaned the project: I tried running flutter clean and rebuilding the project, but the error persists.

Checked the file paths: The error seems to indicate a conflict between two different file paths:

D:\\Sem-8\\Projects\\chat\\build\\path_provider_android
C:\\Users\\haris\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_android-2.2.15\\android

I'm unsure why these paths are conflicting since the project should be using the path_provider_android package from the pub.dev cache.

Reinstalled dependencies: I ran flutter pub get to ensure all dependencies are up to date.

Checked for multiple installations: I checked if there were any issues with multiple installations of path_provider_android or conflicting versions, but couldn't find any clear issues.

Any suggestions or solutions would be greatly appreciated.

2
  • Have you searched for other solutions online? For instance, this question/answer seems to be what you're looking for: stackoverflow.com/questions/69663243/… If not, please add what is different from your case. Commented Feb 4 at 9:31
  • Yes, i referred that. but that wasn't helpful to solve my error. Commented Feb 5 at 10:16

1 Answer 1

0

i got the way to solve this issue.

The issue was due to this the extension "Language Support for Java(TM) by Red Hat".

Once you Disable it the issue will be resolved.

Language Support for Java(TM) by Red Hat

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.