50

I'm trying to build my app on the ios simulator(ios 13), but the build fails and gives an error of pod files: Podfile is out of date

This is the error.

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Warning: Podfile is out of date
  This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes.
  If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions.
To regenerate the Podfile, run:
  rm ios/Podfile

Warning: Podfile is out of date
  This can cause issues if your application depends on plugins that do not support iOS.
  See https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms for details.
  If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/45197 for instructions.
To regenerate the Podfile, run:
  rm ios/Podfile

Running Xcode build...
Xcode build done.                                            7,8s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/kareldebedts/developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:155:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:arrayContainsAny:'
            query = [query queryWhereField:fieldName arrayContainsAny:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kareldebedts/developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:157:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:arrayContainsAny:'
            query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kareldebedts/developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:163:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereField:in:'
            query = [query queryWhereField:fieldName in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kareldebedts/developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:165:24: error: no visible @interface for 'FIRQuery' declares the selector 'queryWhereFieldPath:in:'
            query = [query queryWhereFieldPath:fieldPath in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kareldebedts/developer/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.11/ios/Classes/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' is deprecated [-Wdeprecated-declarations]
          settings.timestampsInSnapshotsEnabled = (bool)call.arguments[@"timestampsInSnapshotsEnabled"];
                   ^
    In module 'FirebaseFirestore' imported from /Users/kareldebedts/DRINKM8/drinkm8_git/ios/Pods/Headers/Public/Firebase/Firebase.h:31:
    /Users/kareldebedts/DRINKM8/drinkm8_git/ios/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked deprecated here
        __attribute__((deprecated));
                       ^
    1 warning and 4 errors generated.

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

I tried rm ios/Podfile , but terminal says the command doesn't exist...

This is my pubspec yaml.

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  firebase_core: ^0.4.0
  firebase_auth: ^0.11.1+12
  flutter_facebook_login: ^2.0.1
  cloud_firestore: ^0.12.7+1
  shared_preferences: ^0.5.3+4
  geolocator: ^5.1.1+1
  url_launcher: ^5.1.2
  rflutter_alert: ^1.0.3
  font_awesome_flutter: ^8.5.0
  flutter_picker: ^1.0.13
  uuid: 2.0.1
  image_picker: ^0.6.1
  path_provider: ^1.2.0
  image: ^2.1.4
  firebase_storage: ^3.0.4
  flutter_datetime_picker: ^1.2.5
  intl: ^0.15.8
  native_contact_picker: ^0.0.6
  flutter_spinkit: ^4.0.0
  transparent_image: ^1.0.0
  connectivity: ^0.4.3+7
  flare_splash_screen: ^2.1.3
  algolia: ^0.1.6+1
  http: ^0.12.0+2
  cloud_functions: ^0.4.1+6
  firebase_messaging: ^5.0.2
  avatar_glow: ^1.0.0
  google_maps_flutter: ^0.5.21+8
  geoflutterfire: ^2.0.2
  rxdart: ^0.22.2
  auto_size_text: ^2.1.0
  camera: ^0.5.4+1
  video_player: ^0.10.2+1
  story_view: ^0.11.0
  thumbnails: ^1.0.1
  image_crop: ^0.3.1
  file_picker: ^1.4.2
  pdf_viewer_plugin: ^1.0.0+2
  flutter_background_geolocation: ^1.3.2
  location_permissions: ^2.0.3
  image_downloader: ^0.19.1
  permission_handler: ^3.3.0
  firebase_database: ^3.1.0

Does someone knows what can cause the problem? Maybe it's because I upgraded the simulator to IOS 13.

starball
  • 20,030
  • 7
  • 43
  • 238
Karel Debedts
  • 5,226
  • 9
  • 30
  • 70

10 Answers10

34

This mostly happens when you upgrade your flutter application, to solve this issue follow bellow steps

  1. Go to Your_Project_Directory/ios/ and remove Podfile or you can do it by running the following command in the root project directory

    rm ios/Podfile
    
  2. Run your project again, this will create a new and updated Podfile for you

    flutter run
    
Seddiq Sorush
  • 2,709
  • 2
  • 20
  • 20
5

Use pod install command in your ios directory to install new pods in your project. Even if you already have a Podfile and ran pod install before. This should work for you. I ran into the same problem some time ago and this is how it was solved.

Kalpesh Kundanani
  • 5,413
  • 4
  • 22
  • 32
  • Thanks! I get this error when I do it... [!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `Runner` to `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` or include the `Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig` in your build configuration (`Flutter/Release.xcconfig`). – Karel Debedts Dec 16 '19 at 19:20
  • 2
    Does this help ? https://guides.cocoapods.org/using/pod-install-vs-update.html Please check.. I am not sure why are you getting such error. let me know in comments if things start working. – Kalpesh Kundanani Dec 16 '19 at 19:22
  • Thank you! Updated the pods, this is the only message I keep getting: Warning: Podfile is out of date This can cause a mismatched version of Flutter to be embedded in your app, which may result in App Store submission rejection or crashes. If you have local Podfile edits you would like to keep, see https://github.com/flutter/flutter/issues/24641 for instructions. To regenerate the Podfile, run: rm ios/Podfile – Karel Debedts Dec 16 '19 at 19:36
  • Was everything working before you upgraded your simmulator ?? And I guess simmulator has nothing to do with build.. the issue must be something else.. – Kalpesh Kundanani Dec 16 '19 at 19:42
  • Yes, but when I run flutter upgrade, there was an error when updating. So I reinstalled flutter completely... – Karel Debedts Dec 16 '19 at 19:47
3

I'm not sure if this will work for everyone but my issue was fixed by running flutter run from the terminal.

I was just using the Flutter launcher from vscode and it kept throwing errors.

I had a Podfile already setup but I think flutter run maybe updated it or reinstantiated it? I'm unsure.

My issue was caused from an update to Flutter

tyirvine
  • 1,861
  • 1
  • 19
  • 29
1

Suggestion after running flutter clean

pod install --verbose

run pod install --verbose because if you use cloud_firestore pod instlal might download gRPC-Core [https://github.com/grpc/grpc.git] which is ~200MB but because of it's git submodules it will end up downloading 1GB. So to see progress of what is goin on run

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
sultanmyrza
  • 4,551
  • 1
  • 30
  • 24
1

MacOS Catalina has changed the default terminal from Bash to ZSH. As a result, we'll be adding configs to ~/.zshrc instead of ~/.bash_profile like we used in the past.

You can manually change from Bash to ZSH anytime by running the following command: chsh -s /bin/zsh Installing Homebrew First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.

Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.

Open Terminal and run the following command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Now that we have Homebrew installed, we can use it to install Ruby.

We're going to use rbenv to install and manage our Ruby versions.

To do this, run the following commands in your Terminal: brew install rbenv ruby-build Add rbenv to bash so that it loads every time you open a terminal echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc source ~/.zshrc

Install Ruby

rbenv install 2.7.2 rbenv global 2.7.2 ruby -v that's all Use pod install command in your ios directory to install new pods in your project. cd ios pod install enjoy

Abid Ali
  • 9
  • 1
1

Just in case, if someone runs into a problem similar to this output after updating the Podfile:

  ld: framework not found intent
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

You can try this:

  1. Go to Xcode Select your target.
  2. Go to Build Settings.
  3. Search the package name shown in the error. e. g. : framework not found intent.
  4. You will see that there is a section like: "Linking"->"Other linker flags" ,then click the bold part of this row.
  5. It will open a dialog box where you can remove the framework not found.
  6. When removing the framework name, also remove the "-framework" tag.

This may be related to packages that only work in Android.

Dharman
  • 30,962
  • 25
  • 85
  • 135
1

If the other solution (sudo arch -x86_64 gem install ffi) does not work for you, try the following one instead:

gem install --user-install ffi -- --enable-libffi-alloc

After that, run pod install or whatever you were trying to do again, but without prefixing it with arch -x86_64.

It worked for me without issues and this way I could also avoid going the Intel emulation (Rosetta 2) way.

0

MacOS Catalina has changed the default terminal from Bash to ZSH. As a result, we'll be adding configs to ~/.zshrc instead of ~/.bash_profile like we used in the past.

You can manually change from Bash to ZSH anytime by running the following command: chsh -s /bin/zsh Installing Homebrew First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.

Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.

Open Terminal and run the following command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Now that we have Homebrew installed, we can use it to install Ruby.

We're going to use rbenv to install and manage our Ruby versions.

To do this, run the following commands in your Terminal:

brew install rbenv ruby-build

Add rbenv to bash so that it loads every time you open a terminal

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc source ~/.zshrc

Install Ruby

rbenv install 2.7.2 rbenv global 2.7.2 ruby -v that's all Use pod install command in your ios directory to install new pods in your project. cd ios pod install enjoy

Abid Ali
  • 9
  • 1
0

go ios folder and try pod install --repo-update

Eray Hamurlu
  • 657
  • 7
  • 9
0

Your problem is: You try to build with deprecated packages.

First of all try to update the repo:

cd ios && pod repo update
cd ..

If this is not fixing the issue you should do the following steps to clean your repository and updated your packages:

flutter clean

then updated all packages to the major version:

flutter pub upgrade --major-versions

then to reload the packages:

flutter pub get 

after that change directory into ios folder with (--verbose give you more information):

cd ios && pod install --verbose

sometimes here some error messages about out-dated packages occures like this:

[!] CocoaPods could not find compatible versions for pod "FirebaseAppCheck":
  In snapshot (Podfile.lock):
    FirebaseAppCheck (= 9.6.0, ~> 9.6.0-beta)

  In Podfile:
    firebase_app_check (from `.symlinks/plugins/firebase_app_check/ios`) was resolved to 0.1.2-3, which depends on
      FirebaseAppCheck (~> 10.7.0-beta)


You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * changed the constraints of dependency `FirebaseAppCheck` inside your development pod `firebase_app_check`.
   You should run `pod update FirebaseAppCheck` to apply changes you've made.

Then you need to follow the instructions in the error description!

then change back to main directory:

cd ..
redbasecap
  • 31
  • 3