'Module 'path_provider' not found
I have used several times the Xcode simulator for my flutter app. One time I tried to change the simulator to iPhone 11 Pro (don't know if it did or did not cause the problem) but since then:
- I get the error Module 'path_provider' not found.
- It seems that each time when I double click on the Runner.xcworkspace file, it opens the project file instead. I'm new to Xcode so not quite sure about that but I attached a screenshot.
Things I've tried:
- updated according to the instructions in the warnings (which can be seen in the screenshot).
- deleted all Xcode cache with Reset Xcode
- deleted the android studio project and popped it again from git.
- flutter clean + removed all the pod files + pod install from android studio terminal. according to the explanations here: reinstall pod
What else can I do?
Solution 1:[1]
I had the same issue. All I had to do was open the runner.xcworkspace
instead of runner.xcodeproj
and run the app.
Solution 2:[2]
I faced this same error and realized that I have used pod init
manually so I deleted the Podfile
in the ios
folder then run flutter build ios
.
The Flutter will generate the Podfile
correctly and everything works well after that.
Solution 3:[3]
The problem for me, as it seems, was that the Xcode opened "Runner.xcodeproj" instead of "Runner.xcworkspace" from what I understood, .xcworkspace is the one that makes the bindings/connections between files and packages. xcodeproj doesn't do it and that's why it was missin although I did have it.
Solution: To be sure I do have the updated version of the missing package:
- cd [project path]
- Flutter clean (or delete the build folder to ensure there is no cache)
- cd [project path]/ios
- pod install
- pod update
Then, when opening the Xcode I clicked: Project navigator (folder icon on the left toolbar) -> Runner (in the project tree that opened) -> Runner (under Targets) (shown in the attached picture)
and then when I build it worked for me.
Solution 4:[4]
In Podfile
, I just comment platform :ios, '11.0'
, it worked!
Solution 5:[5]
I had the same problem that was caused by the linker. I solved it as follows: runner->build setting->other linker flags, and delete path_provider
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PeakGen |
Solution 2 | leegor |
Solution 3 | |
Solution 4 | smallLabel |
Solution 5 | Asaf Pinhassi |