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.
