26

I have been trying to build my flutter app in iOS simulator but getting build error with following screenshot.

Where my Xcode version is 11.0, CocoaPods version 1.9.3, Flutter version 1.22.0

I have also upgraded connectivity package from 0.4.9+2 to 0.4.9+3 which is latest one. Following some steps by googling but no one is working yet. However my android build is fully ok.

Thanks in advance.

enter image description here

14 Answers 14

20

I was opening ios/Runner.xcodeproj instead of ios/Runner.xcworkspace.

Opening ios/Runner.xcworkspace from Xcode worked for me!

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

1 Comment

what a f**king solution :D i works thanks!
19

I have solved this issue through running this command in terminal at Project folder directory

rm ios/Podfile && flutter build ios

1 Comment

I think this is dangerous because this rebuilds the entire ios folder again. ONLY DO THIS IF YOU WANT THIS
17

I solved this problem by setting in the podfile

platform :ios, '12.1'

And then later inserting the same version in Xcode as well

Xcode

2 Comments

This is the only solution that worked for my device.
This one worked for me as well after minutes of trial and error
4

My solution:

Firstly, open ios/Runner.xcworkspace instead of ios/Runner.xcworkproj.

Then follow the steps:

  1. Delete Podfile and Podfile.lock in the ios folder
  2. flutter clean
  3. flutter pub get
  4. cd ios then run pod install --repo-update
  5. flutter build ios

1 Comment

pod install --repo-update did it for me
3

If you are working with flavoured build, e.g staging, production, development.

Your app will most likely be running on Runner so click on runner and select the correct build build flavour which in this case would be one of the flavours.

Comments

2

I have this issue and this sequence of steps have worked for me.

  1. Go to the ios folder #cd ios
  2. Delete the Podfile #rm Podfile
  3. Run flutter clean
  4. Run flutter pub get
  5. Case you need generate files with build_runner #flutter packages pub run build_runner build --delete-conflicting-outputs
  6. Build for app for iOS. #flutter build ios
  7. Generate your project pods. #cd ios && pod install
  8. Build project from XCode

Comments

2

Alternatively, go to your flutter appname/ios folder and type in commandline:

   sudo gem install cocoapods
   flutter pub get    <---may or may not be necessary for you
   pod install

This will install the infuriating cocoapods to your project

Comments

2

am also faced this issue so many times, you can solve this issue by

opening Runner.xcworkspace , Basically everyone open Runner.xcodeproj this file instead of Runner.xcworkspace

1 Comment

man really thank you , I know your information but I am stupid I forgot about that , and take so much time on it
1
  1. rm ios/Podfile && flutter build ios
  2. Change the platform number on Podfile "platform :ios, '12.1" (in XCode: Pick 12.1v.--> Runner > info IOS Deployment Target: 12.1)
  3. Open the flutter ios folder (right-click on ios folder in vs. code and click "Open in Xcode")
  4. Go to Product > Schemes > New Scheme
  5. Select the name of your Cocoapod, then click OK

build again

Comments

0

In many cases it comes because of difference between Pod install version in flutter and Xcode. Just check them or simply add 'platform :ios, '11.0'' to your podfile in flutter.

1 Comment

This answer was already provided, and does not need to be repeated.
0

I just fixed but running project via "Runner.xcworkspace"enter image description here

Comments

0

What worked for me was running flutter create to fix the ios folder.

I actually deleted the ios folder completely (rm -rf ios), ran flutter create <dir> and then it started building again. 🙌

DISCLAIMER: Of course, all my previous ios specific configuration was lost, but that's why we version track everything with git. Then I went over all modified files to actually revert back all my ios customizations.

Comments

-1

it's mean som dependencies missing on project. I solved same problem by this step.

cd /YourProject/iOS
rm Podfile

flutter clean On your IDE

flutter pub get

And cd /YourProject/iOS

pod install

Comments

-2

in xode clear build and close xcode and run this in project folder.

flutter clean && fluttter pub get && cd ios && rm ios/Podfile &&  cd .. &&flutter build ios

open xcworkspace instead of xcodeproj. build the project

2 Comments

there are so many mistakes in your answer. I think what you wanted to communicate was this: flutter clean && flutter pub get && rm ios/Podfile && flutter build ios For me it did not work. Still have the same problem as Mimu
try deleting pod and pod lock from ios folder then run flutter build ios.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.