我正在尝试在 Mac 上的 iOS 上运行 Flutter 应用程序。当我尝试构建项目时,它给了我这个错误:
Xcode's output: ↳ === BUILD TARGET shared_preferences OF PROJECT Pods WITH CONFIGURATION Debug === In file included from /Users/(username)/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.2.4/ios/Classes/SharedPreferencesPlugin.m:5: /Users/(username)/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.2.4/ios/Classes/SharedPreferencesPlugin.h:1:9: fatal error: 'Flutter/Flutter.h' file not found #import ^~~~~~~~~~~~~~~~~~~ 1 error generated. Could not build the application for the simulator.
我尝试从不同的 Flutter channel 构建它,没有变化。
知道哪里出了问题吗?
编辑: flutter 版本 0.2.8 pod 版本 1.5.0
最佳答案
https://github.com/flutter/flutter/issues/16036#issuecomment-380712094提供似乎对其他人有用的说明
Can I ask you to try the following:
- make sure you have Cocoapods 1.5.0 installed (
pod --version
should say1.5.0
)- change any dependencies you have on the
firebase_xxx
,google_sign_in
, orcloud_firestore
plugins to the newest versions (look for changelog entries referring to Cocoapods 1.5.0)- change your
ios/Podfile
to the newest version on Flutter master branch (https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/cocoapods)- delete
ios/Podfile.lock
andios/Pods
switch to Flutter master branchflutter clean ; flutter run
关于ios - Flutter 中的共享首选项错误 - Mac 上的 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49984891/