Flutter CocoaPods (Podfile) Fix
Error: module ‘path_provider’ not found (solved)
Guide to Fix Error:
- Update CocoaPod if it is not updated (if not installed, run command: sudo gem install cocoapods)
- Make flutter channel to master (cmd: flutter channel master)
- Upgrade flutter (cmd: flutter upgrade)
- Switch to flutter project directory (cmd: cd <project-folder>)
- Clean flutter project (cmd: flutter clean) then get dependencies (cmd: flutter pub get)
- Change to ios folder in project directory (cmd: cd ios)
- Deintegrate pod (cmd: pod deintegrate)
- Install pod (cmd: pod install)
That’s all. Hope it helps.
PS: If the above method doesn’t work, just create a new flutter project and copy your “lib”, “assets” and “pubspec.yaml” folders/files to your new project and run it.