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

Kar*_*dts 34 iphone xcode ios flutter podfile

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.
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

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

Thanks in advance!

Par*_*iya 80

大多数情况下,当我更新 flutter SDK 时都会发生这种情况,但不要跳过更新以使其更好更容易,因为它很容易解决

有必要修复 - 删除 Pods 文件夹的内容将解决问题,这是如何执行此操作的过程

  1. 要完全清理(删除所有指向链接的点)并创建升级到新的(卸载并再次安装),请编写以下命令

    flutter clean
    rm -Rf ios/Pods
    rm -Rf ios/.symlinks
    rm -Rf ios/Flutter/Flutter.framework
    rm -Rf ios/Flutter/Flutter.podspec
    
    Run Code Online (Sandbox Code Playgroud)
  2. 然后为了重现 Podfile 遵循这个命令

    rm ios/Podfile
    
    Run Code Online (Sandbox Code Playgroud)
  3. 最后,您的项目已准备就绪,可以开始了

    flutter run
    
    Run Code Online (Sandbox Code Playgroud)

  • 太感谢了!每次升级flutter都会发生。提示:如果应用程序在构建时仍然崩溃:查找“错误”。就我而言,有一个包在清理所有 Pod 后仍然无法在新的 Flutter 版本中运行。建议将软件包升级到最新版本。 (2认同)

Sed*_*ush 21

这主要发生在升级 Flutter 应用程序时,要解决此问题,请按照以下步骤操作

  1. 转到Your_Project_Directory/ios/并删除Podfile或者您可以通过在根项目目录中运行以下命令来完成

    rm ios/Podfile
    
    Run Code Online (Sandbox Code Playgroud)
  2. Run再次您的项目,这将为您创建一个新的和更新Podfile

    flutter run
    
    Run Code Online (Sandbox Code Playgroud)


Kal*_*ani 6

使用pod installios 目录中的命令在项目中安装新的 pod。即使您已经有 Podfile 并之前运行过 pod install。这应该对你有用。我前段时间遇到了同样的问题,这就是解决的方法。

  • 这有帮助吗?https://guides.cocoapods.org/using/pod-install-vs-update.html 请检查..我不确定你为什么会收到这样的错误。如果事情开始起作用,请在评论中告诉我。 (2认同)