运行应用程序时颤振 ios 错误:词法或预处理器问题 (Xcode):找不到'Flutter/Flutter.h'文件



Xcode的输出:↳正在将结果捆绑包写入路径:/var/folders/t_d4qsnct51tvftvp8_gx0smlw0000gn/t/fluft_tools.IV7Tent/fluft_ios_build_temp_dir98238e/temporary_xresult_bundle

Command CompileSwiftSources failed with a nonzero exit code
/Users/user/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/ios/Classes/messages.g.m:7:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'permission_handler_apple' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'network_info_plus' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'geolocator_apple' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'Toast' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'Starscream' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'Sodium' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'ReachabilitySwift' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'FMDB' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'fluttertoast' from project 'Pods')
/Users/user/Documents/fixValidation/mobile_sahla_chauffeur/ios/Pods/Pods.xcodeproj: 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 15.5.99. (in target 'PusherSwiftWithEncryption' from project 'Pods')
Result bundle written to path:
/var/folders/t_/d4qsnct51tvftvp8_gx0smlw0000gn/T/flutter_tools.IV7Tnt/flutter_ios_build_temp_dir98238e/temporary_xcresult_bundle

尝试通过在项目目录的终端中启动这些命令来清理Flutter和iOS项目。

  1. flutter clean这将为您清理颤振项目
  2. cd ios && pod deintegrate这将为您清理iOS项目
  3. 删除Podfile.lockpods目录,这将删除iOS项目中的所有依赖项
  4. 通过启动以下命令cd..返回到项目的根目录,运行flutter pub get
  5. 转到iOS目录(cd ios(并启动pod安装

这将清理您的iOS和Flutter应用程序,您可能能够解决您的问题。

最新更新