未找到 Flutter shared_preferences 模块 - iOS Xcode 构建

Xqu*_*ick 5 xcode sharedpreferences ios flutter

shared_preferences在 Flutter 中使用依赖项。

构建 Xcode (Product->archive - for Generic target) 失败

module 'shared_preferences' not found
Run Code Online (Sandbox Code Playgroud)

在 Xcode 中构建失败

我尝试过flutter cleanflutter pub cache repair尝试将 Flutter lib/ 移动到新项目 ( flutter create .) 中,并且我使用较旧的 Xcode 版本 (11.4.1) 进行构建。目前我有 12.0 beta 3。

奇怪的是,在我的 IDE (IntelliJ) 中的 Emulator 中运行可以正常工作,没有错误。

IDE Emulator dart main 运行正常

这些是我的依赖项(pubspec.yaml)

dependencies:
  flutter:
    sdk: flutter
  http: ^0.12.2
  intl: any
  flutter_spinkit: ^4.1.2
  redux: any
  flutter_redux: any
  redux_thunk: any
  shared_preferences: 0.5.1+2
Run Code Online (Sandbox Code Playgroud)

Xqu*_*ick 9

就我而言,问题是我从 Project.xcodeproj 而不是 Project.xcworkspace 打开 Xcode 项目。