13

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:

  1. I get the error Module 'path_provider' not found.
  2. 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?

enter image description here

2
  • Did you manage to resolve this? Commented Jun 12, 2021 at 7:55
  • I somehow solved it long time ago, I posted the solution I think it solved for me. Update if it solved for you too Commented Jun 16, 2021 at 9:56

9 Answers 9

21

I had the same issue. All I had to do was open the runner.xcworkspace instead of runner.xcodeproj and run the app.

Sign up to request clarification or add additional context in comments.

1 Comment

it just worked! :)
10

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.

1 Comment

Thank you very much. I had spent the whole day look for a solution. Yours is the only one that worked for me. I had done Pod Init instead of letting flutter generate it for me.
3

In Flutter project, I Also faced with this issue. Fixed by updating flutter and cocoa pods to the latest version.

flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
flutter pub get
  • Move to podfile (project_name/ios/Podfile) and comment platform :ios, '11.0' like this # platform :ios, '11.0' then run this commands
cd ios
pod install
arch -x86_64 pod install  //(On an M1 mac use => arch -x86_64 pod install)
cd ..
flutter run

Comments

2

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:

  1. cd [project path]
  2. Flutter clean (or delete the build folder to ensure there is no cache)
  3. cd [project path]/ios
  4. pod install
  5. 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.

enter image description here

2 Comments

i have perform above steps but still getting same error.
This works for me, but I first deleted my Podfile, then ran flutter build ios, and finally opened Runner.xcworkspace in Xcode instead of Runner.xcodeproj
1

My technique is basically to rip it up and start again - keeping all the lib files though! That way you can keep track of what you need to do to fix the things you broke trying to fix it earlier !

I create a new flutter project and add the lib files from the broken project. then piece by piece put it back together. I decided on this idea after trawling through many 'patches' to the specific errors that I saw. I should not have been anywhere near those errors - so patching them just broke more - untraceably. Hence the rebuild.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
0

In Podfile, I just comment platform :ios, '11.0', it worked!

Comments

0

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

Comments

0

I was facing the same issue due to google_fonts library. I removed it and it works.

Comments

0

I was having the same issues and in the end, I fixed it by:

  1. Deleting the macos (or ios) folder
  2. Run flutter create --platform=macos,ios .

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.