Flutter iOS构建失败:Pod文件错误 [英] Flutter ios build failed: pod files error
问题描述
我正在尝试在ios模拟器(ios 13)上构建我的应用程序,但是构建失败.
I'm trying to build my app on the ios simulator (ios 13) , but the build fails.
这是错误.
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
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.
我尝试了rm ios/Podfile,但是终端说该命令不存在...
I tried rm ios/Podfile , but terminal says the command doesn't exist...
这是我的pubspec yaml.
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
有人知道什么会导致问题吗? 也许是因为我将模拟器升级到了IOS 13 ...
Does someone knows what can cause the problem? Maybe it's because I upgraded the simulator to IOS 13...
提前谢谢!
推荐答案
在大多数情况下,当我更新flutter SDK时都会发生这种情况,但是请不要跳过更新以使其变得更好,更容易,因为它很容易解决
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
有必要修复-删除Pods文件夹中的内容将解决此问题,这是执行此操作的过程
It is necessary to fix - Removing contents of Pods folder will solve the issue, Here is the process of how to do this
-
要完全清理(删除链接的所有点)并创建升级到新版本(也要卸载并再次安装),请编写以下命令
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
然后使用此命令复制Podfile
Then for reproduce Podfile follow this command
rm ios/Podfile
最后,您的项目已准备就绪,可以开始进行
Finally your project is ready to good to go
flutter run
这篇关于Flutter iOS构建失败:Pod文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!