ios - Flutter 中的共享首选项错误 - Mac 上的 iOS

标签 ios sharedpreferences flutter

我正在尝试在 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 say 1.5.0)
  • change any dependencies you have on the firebase_xxx, google_sign_in, or cloud_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 and ios/Pods switch to Flutter master branch
  • flutter clean ; flutter run

关于ios - Flutter 中的共享首选项错误 - Mac 上的 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49984891/

相关文章:

ios - 而不是图像,以前的视频(AVPlayer)显示在 ios 的 UIImageView 中

ios - 如何在 UITextView textViewDidBeginEditing 中手动显示/停止键盘

java - Android 中的简单 SharedPreferences

flutter - 内置值对象的 setter 是什么

flutter - Flutter-从应用程序接收到错误-32601:找不到方法

flutter - 在 Flutter 中的 TableRows 之间添加一些空间

iphone - 将字符串转换为 NSDate 问题 : [__NSDate Length] unrecognized selected

ios - subview 中的 @State 和 @Published 属性,SwiftUI

Google 备份服务的共享首选项的 Android 备份不起作用

android - 默认 SharedPreferences 不保存值