Reputation: 916
Disclaimer: First of all, this is my early attempt to play with Flutter. So forgive me if is a noob question.
I had been playing with an MVP-Clean architecture for Flutter apps in iOS, and when trying to build a data source where I can persist data easily I found PathProvider plugin.
After trying the next:
Add dependencies to the project
dependencies: path_provider: "^0.4.0"
Provide dependencies
flutter packages get
pod install
I try to compile the project and the compiler shouts: ** BUILD FAILED **
Xcode's output: ↳ === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug === /proect_directory/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'path_provider/PathProviderPlugin.h' file not found #import <path_provider/PathProviderPlugin.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
I did a quick search and I did not find anything useful.
Could anyone illuminate my path?
EDIT:
Already tried with:
flutter update-packages --force-upgrade
And the doctor output does not show any errors:
flutter doctor
Upvotes: 6
Views: 8973
Reputation: 2675
I encountered a similar issue and solved it with these simple steps:
flutter clean
then flutter pub get
Upvotes: 0
Reputation: 47
i have just deleted the podfile.lock and podfile then i run the command flutter build ios ,it install podfile and podlock perfectly but build was failed because i didnt set the team for provision, so then i came to the terminal of android studio and run the command flutter run and it works!...
Upvotes: 1
Reputation: 786
For me this was solved by editing podfile as mentioned by this https://github.com/flutter/flutter/issues/10654#issuecomment-389034245 and change the xcode's build system to legacy.
Upvotes: 0
Reputation: 129
Do this for any files for which compiler is complaining, till you are able to build your project.
Upvotes: 1
Reputation: 661
This issue should be fixed by https://github.com/flutter/flutter/pull/15437
To apply the fix to an existing project, add these lines to ios/Podfile.
Upvotes: 3
Reputation: 916
I finally find a workaround.
I went to the GitHub repo, found the PathProviderPlugin.h
file, and put it inside the location:
build/ios/Debug-iphonesimulator/path_provider/path_provider.framework/Headers/
Sounds a little bit dirty, but was the only way to keep coding.
Hope helps someone. And thanks to @GünterZöchbauer to help me find a useful lead.
Upvotes: 2