Flutter CocoaPods (Podfile) Fix

Error: module ‘path_provider’ not found (solved)

Guide to Fix Error:

  1. Update CocoaPod if it is not updated (if not installed, run command: sudo gem install cocoapods)
  2. Make flutter channel to master (cmd: flutter channel master)
  3. Upgrade flutter (cmd: flutter upgrade)
  4. Switch to flutter project directory (cmd: cd <project-folder>)
  5. Clean flutter project (cmd: flutter clean) then get dependencies (cmd: flutter pub get)
  6. Change to ios folder in project directory (cmd: cd ios)
  7. Deintegrate pod (cmd: pod deintegrate)
  8. 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.

--

--

Read details on Twitter/LinkedIn

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store