Flutterfire: [cloud_firestore] iOS build failed

Created on 6 Aug 2020  ·  6Comments  ·  Source: FirebaseExtended/flutterfire

Describe the bug
After adding cloud_firestore: any to pubspec and launching it, Flutter fails to build the IOS App and outputs the following:

Launching lib/main.dart on iPhone 8 in debug mode...
Running pod install...
Xcode build done.                                           50.8s
Failed to build iOS app
Exited (sigterm)
Could not build the application for the simulator.
Error launching application on iPhone 8.

To Reproduce
Steps to reproduce the behavior:

  1. Run "flutter create (projectname)"
  2. Open pubspec.yaml
  3. Add "cloud_firestore: any" to dependencies
  4. flutter pub get
  5. Run "flutter run"
  6. Get Error Message

Expected behavior
I expected it, to build the ios App successfully and then open the app in the Xcode Simulator.

Additional context
I tried different versions of cloud_firestore, Flutter and Cocoapods.
And when I put the GoogleService-Info.plist in the Runner/Runner folder and run it i get the following Error

Xcode's output:
↳
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/server/async_generic_service.cc:19:10:
    fatal error: 'grpcpp/generic/async_generic_service.h' file not found
    #include <grpcpp/generic/async_generic_service.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/server/async_generic_service.cc:19:10:
    note: did not find header 'generic/async_generic_service.h' in framework 'grpcpp' (loaded
    from '/Users/sav/workspace/github/build/ios/Debug-iphonesimulator/gRPC-C++')
    1 error generated.
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/server/channel_argument_option.cc:19:10
    : fatal error: 'grpcpp/impl/channel_argument_option.h' file not found
    #include <grpcpp/impl/channel_argument_option.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/server/channel_argument_option.cc:19:10
    : note: did not find header 'impl/channel_argument_option.h' in framework 'grpcpp' (loaded
    from '/Users/sav/workspace/github/build/ios/Debug-iphonesimulator/gRPC-C++')
    1 error generated.
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/client/client_interceptor.cc:19:10:
    fatal error: 'grpcpp/impl/codegen/client_interceptor.h' file not found
    #include <grpcpp/impl/codegen/client_interceptor.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/sav/workspace/github/ios/Pods/gRPC-C++/src/cpp/client/client_interceptor.cc:19:10:
    note: did not find header 'impl/codegen/client_interceptor.h' in framework 'grpcpp' (loaded
    from '/Users/sav/workspace/github/build/ios/Debug-iphonesimulator/gRPC-C++')
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Flutter doctor
Run flutter doctor and paste the output below:

[✓] Flutter (Channel stable, 1.20.0, on Mac OS X 10.15.6 19G73, locale en-CH)
    • Flutter version 1.20.0 at /Users/sav/development/flutter
    • Framework revision 840c9205b3 (33 hours ago), 2020-08-04 20:55:12 -0700
    • Engine revision c8e3b94853
    • Dart version 2.9.0


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/sav/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.47.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.2

[✓] Connected device (1 available)
    • iPhone 8 (mobile) • A4587B9D-A8A4-462D-A1DC-5A38AA6B2E2B • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)

• No issues found!

Most helpful comment

@NoahVersace
Thanks a lot, man! You literally saved hours of refactoring the project!

I really appreciate it, btw this is the project I am talking about. It is a flutter chatting app called "beast". Under development.

https://github.com/yazeedalkhalaf/beast

All 6 comments

The problem was gRPC itself. It probably failed cloning all the files to the cached version of gRPC-C++. I deleted the cached version and now it works.

The problem was gRPC itself. It probably failed cloning all the files to the cached version of gRPC-C++. I deleted the cached version and now it works.

Hey @NoahVersace , I faced the similar issues. Could you share more about where to deleted the cached version of gRPC-C++ ?

Thanks a lot !

Me Too @NoahVersace

The problem was gRPC itself. It probably failed cloning all the files to the cached version of gRPC-C++. I deleted the cached version and now it works.

Hey @NoahVersace , I faced the similar issues. Could you share more about where to deleted the cached version of gRPC-C++ ?

Thanks a lot !

Hey @shingsoso @YazeedAlKhalaf

What I did is:

  1. Open terminal
  2. Enter cd /Users/yourusername/Library/Caches/CocoaPods/Pods/Release/
  3. Enter open .
  4. Delete gRPC-C++
  5. Go back to your flutter project, navigate in to the ios/Pods folder and delete gRPC-C++
  6. Run your flutter app

Cocoapods will then detect, when trying to install the gRPC-C++ Pod, that there is no cached version and clone it again from its repository.

I hope this helps!

@NoahVersace
Thanks a lot, man! You literally saved hours of refactoring the project!

I really appreciate it, btw this is the project I am talking about. It is a flutter chatting app called "beast". Under development.

https://github.com/yazeedalkhalaf/beast

@NoahVersace
Thanks a lot, man! You literally saved hours of refactoring the project!

I really appreciate it, btw this is the project I am talking about. It is a flutter chatting app called "beast". Under development.

https://github.com/yazeedalkhalaf/beast
Nice, I'm very glad to hear that I could help and good luck with your project beast. 👍

Was this page helpful?
0 / 5 - 0 ratings