我有一个颤振项目。首先它必须在 Android 上运行并且它可以运行!一切都很酷。是时候让它在 iOS 上运行了,但是当我尝试在 iOS 模拟器上启动项目时出现以下错误:
\nLaunching lib/main.dart on iPhone 12 Pro Max in debug mode...\nRunning Xcode build...\nXcode build done. 13,1s\nFailed to build iOS app\nError output from Xcode build:\n\xe2\x86\xb3\n ** BUILD FAILED **\n\n\nXcode's output:\n\xe2\x86\xb3\n While building module 'firebase_core' imported from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:\n In file included from <module-includes>:1:\n In file included from /Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:\n In file included from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebaseCorePlugin.h:12:\n /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]\n\n--------------------------------- HERE --------------------------------\n\n #import <FirebaseCore/FirebaseCore.h>\n ^\n 1 error generated.\n /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:9: fatal error: could not build module 'firebase_core'\n\n--------------------------------- HERE --------------------------------\n #import <firebase_core/FLTFirebasePluginRegistry.h>\n ~~~~~~~^\n 2 errors generated.\n While building module 'firebase_core' imported from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:\n In file included from <module-includes>:1:\n In file included from /Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Target Support Files/firebase_core/firebase_core-umbrella.h:13:\n In file included from /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebaseCorePlugin.h:12:\n /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.8.0/ios/Classes/FLTFirebasePlugin.h:9:9: error: include of non-modular header inside framework module 'firebase_core.FLTFirebasePlugin': '/Users/ew/Dev/projects/SWIE%20-%20ink%20-%20mobil/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore.h' [-Werror,-Wnon-modular-include-in-framework-module]\n #import <FirebaseCore/FirebaseCore.h>\n ^\n 1 error generated.\n /Users/ew/Dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-10.0.6/ios/Classes/FLTFirebaseMessagingPlugin.m:6:9: fatal error: could not build module 'firebase_core'\n #import <firebase_core/FLTFirebasePluginRegistry.h>\n ~~~~~~~^\n 2 errors generated.\n note: Using new build system\n note: Building targets in parallel\n note: Planning build\n note: Constructing build description\n warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'Toast' from project 'Pods')\n warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'FMDB' from project 'Pods')\n warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.3.99. (in target 'Reachability' from project 'Pods')\n\nCould not build the application for the simulator.\nError launching application on iPhone 12 Pro Max.\nRun Code Online (Sandbox Code Playgroud)\n遗憾的是我没有找到任何可行的解决方案......
\n这是我的 pubspec.yaml (firebase 依赖项):
\n firebase_performance: ^0.7.0+7\n firebase_crashlytics: ^2.1.1\n firebase_core: any\n firebase_messaging: ^10.0.6\n flutter_local_notifications: ^8.1.1+2\nRun Code Online (Sandbox Code Playgroud)\n
小智 6
删除ios/Pods文件夹。
删除Podfile和Podfile.lock
删除pubspec.lock
打开终端并依次运行这些命令
cd ios
pod cache clean --all
flutter clean
flutter pub get
pod install
Run Code Online (Sandbox Code Playgroud)
Gbe*_*uga -1
这个错误来自 .pub-cache,所以只需 flutter clean,如果错误仍然存在,请删除所有 .pub-cache
从 pubspec.yaml 中的依赖项中删除包,运行 flutter packages get。然后再次将包添加到依赖项中并运行 flutter packages get。这个过程已经为我解决了过去的问题。
扑干净
和酒吧得到
| 归档时间: |
|
| 查看次数: |
12351 次 |
| 最近记录: |