Getting error when running app on iOS simulator in Flutter after installing cloud_firestore package

1.3k views Asked by At

I have tried even pod update Firebase/Firestore still getting below error when running on iOS simulator after installing cloud_firestore package.

Even I have tried to delete Podfile.lock many times and flutter clean then flutter run.

Note:

  1. Flutter version: Flutter 2.0.2

  2. Dart 2.12.1

    Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **

    Xcode's output:
    ↳
        In file included from /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/thread_identity.cc:26:
        In file included from /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/call_once.h:34:
        /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/invoke.h:42:10: fatal error: 'absl/meta/type_traits.h' file not found
        #include "absl/meta/type_traits.h"
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
        /Users/gwl/firebase_demo/ios/Pods/abseil/absl/base/internal/invoke.h:42:10: note: did not find header 'meta/type_traits.h' in framework 'absl' (loaded from
        '/Users/gwl/firebase_demo/build/ios/Debug-iphonesimulator/abseil')
        1 error generated.
        note: Using new build system
        note: Building targets in parallel
        note: Planning build
        note: Constructing build description
    
    Could not build the application for the simulator.
    Error launching application on iPhone 11.
    
3

There are 3 answers

0
SMEW Technology On

U need to delete the podfile.lock

then u need to run iOS folder from XCode to load assets for your projects

Go to ios folder and execute pod install and if it doesn't exist execute pod init then pod install

Please try Xcode -> Product -> Run

0
Muhtar On

First delete podfile.lock and follow the steps below ;

flutter clean
flutter pub get
cd ios
pod install
flutter run

If doesnt work check your flutter channel and change it to beta.

flutter pub upgrade
flutter channel beta
flutter clean
cd ios
pod install
flutter run

Also you can switch back to stable typing below;

flutter channel beta
0
Tnaffh On

This solved my issue GitHub issue

try running these commands in your ios directory:

rm -rf Pods
rm -rf Podfile.lock
rm -rf ~/.pub-cache/hosted/pub.dartlang.org/
pod cache clean --all
flutter clean
flutter pub get
pod repo update
pod install