Flutter shared_preferences module not found - iOS Xcode build

4,757

Solution 1

In my case problem was that I was opening Xcode project from Project.xcodeproj instead of Project.xcworkspace.

Solution 2

Searching on Stack Overflow I found this Flutter module not found in Xcode Which links to this https://github.com/flutter/flutter/issues/54599#issuecomment-644336055

This solved it for me!

enter image description here

Solution 3

I had to change the scheme in the following manner:

Product -> Scheme -> Edit Scheme

enter image description here

Share:
4,757
Xquick
Author by

Xquick

Coding since 2012 - Javascript and all those frameworks

Updated on December 22, 2022

Comments

  • Xquick
    Xquick over 1 year

    I am using shared_preferences dependency in Flutter.

    Building Xcode (Product->archive - for Generic target) fails with

    module 'shared_preferences' not found
    

    Build in Xcode fails

    I tried flutter clean, flutter pub cache repair, tried moving Flutter lib/ into new project (flutter create .) and I building using older Xcode version (11.4.1)..currently I have 12.0 beta 3.

    What is weird is that running in Emulator from my IDE (IntelliJ) works just fine with no errors.

    IDE Emulator dart main runs OK

    These are my dependencies (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