Flutter iOS build failed an error of pod files: Podfile is out of date

52,971

Solution 1

This happens to most of times when i update the flutter SDK, But don't skip updating to make it better and easier because it is very easy to solve

It is necessary to fix - Removing contents of Pods folder will solve the issue, Here is the process of how to do this

  1. To completely clean(Removing all points to links) and create upgraded to the new(uninstall and installing again too), Write following command

    flutter clean
    rm -Rf ios/Pods
    rm -Rf ios/.symlinks
    rm -Rf ios/Flutter/Flutter.framework
    rm -Rf ios/Flutter/Flutter.podspec
    
  2. Then for reproduce Podfile follow this command

    rm ios/Podfile
    
  3. Finally your project is ready to good to go

    flutter run
    

Solution 2

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
    

Solution 3

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.

Solution 4

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

Solution 5

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.

Share:
52,971
Karel Debedts
Author by

Karel Debedts

Updated on July 09, 2022

Comments

  • Karel Debedts
    Karel Debedts almost 2 years

    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...

    Thanks in advance!

  • Karel Debedts
    Karel Debedts over 4 years
    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).
  • Kalpesh Kundanani
    Kalpesh Kundanani over 4 years
    Does this help ? 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.
  • Karel Debedts
    Karel Debedts over 4 years
    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 github.com/flutter/flutter/issues/24641 for instructions. To regenerate the Podfile, run: rm ios/Podfile
  • Kalpesh Kundanani
    Kalpesh Kundanani over 4 years
    Was everything working before you upgraded your simmulator ?? And I guess simmulator has nothing to do with build.. the issue must be something else..
  • Karel Debedts
    Karel Debedts over 4 years
    Yes, but when I run flutter upgrade, there was an error when updating. So I reinstalled flutter completely...
  • tyirvine
    tyirvine about 4 years
    Keep in mind tho, that this won't report to the debug console
  • Karel Debedts
    Karel Debedts over 3 years
    Thank you so much! Happens every time I upgrade flutter. TIP: if the app still crashes when building: look for the "ERROR". In my case, there was a package that still wouldn't run with the new flutter version after cleaning all the pods. Upgrading the packages to the latest version is recommended.
  • Amber K
    Amber K over 3 years
    If you're getting iOS 8.0 version error on Xcode 12. The above will still not help you. Refer this: jessesquires.com/blog/2020/07/20/…