首页 文章

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

提问于
浏览
0

我正试图在Mac上的iOS上运行Flutter应用程序 . 当我尝试构建项目时,它给了我这个错误:

Xcode的输出:↳===构建目标具有CONFIGURATION的PROJECT Pod的shared_preferences调试===在/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:致命错误:'Flutter / Flutter.h'文件未找到#import ^ ~~~~~~~~~~~~~~~~~~ 1生成错误 . 无法为模拟器构建应用程序 .

我试图从不同的Flutter Channels 构建它,没有变化 .

知道什么是错的吗?

编辑:flutter版本0.2.8 pod版本1.5.0

2 回答

  • 2

    https://github.com/flutter/flutter/issues/16036#issuecomment-380712094提供了似乎对其他人有用的说明

    我可以请你尝试以下方法:确保安装了Cocoapods 1.5.0(pod --version应该说1.5.0)将你对firebase_xxx,google_sign_in或cloud_firestore插件的任何依赖关系更改为最新版本(看看对于引用Cocoapods 1.5.0的更改日志条目,将您的ios / Podfile更改为Flutter master分支上的最新版本(https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/cocoapods)删除ios /Podfile.lock和ios / Pods切换到Flutter master branch flutter clean;扑了一下

  • 0

    尝试包含audioplayer包时,我遇到了类似的问题

    ... audioplayer-0.4.0 / ios / Classes / AudioplayerPlugin.h:1:9:致命错误:找不到'Flutter / Flutter.h'文件 .

    我以为我是最新的,但是在我做了Flutter升级,然后从我项目下的ios目录中删除了Podfile,Podfile.lock和Pods文件夹(并且运行了干净),我终于能够构建和推出到iOS . 见https://github.com/flutter/flutter/pull/16273

    我正在使用Xcode 9.3和Cocoapods 1.5.0 .

    Flutter在升级后显示版本0.3.1 .

相关问题