4
votes

I am facing this issue while compiling the app for ios

this is the whole stacktrace:

Launching lib/main.dart on iPhone Xs Max in debug mode... Running pod install... Running Xcode build... Xcode build done.
2,4s Failed to build iOS app Error output from Xcode build: ↳ ** BUILD FAILED **

Xcode's output: ↳ === BUILD TARGET FirebaseAuth OF PROJECT Pods WITH CONFIGURATION Debug === In file included from /Users/danielec/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.1+3/ios/Classes/GoogleSignInPlugin.m:5: /Users/danielec/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.1+3/ios/Classes/GoogleSignInPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found #import ^~~~~~~~~~~~~~~~~~~ 1 error generated.

I tried reinstalling both firebase_auth and google_sign_in, removing and reinstalling cocoapods, I don't know what else to do, as any one experienced this problem before?

Versions:

  • Cocoapods: 1.6.1
  • firebase_auth: ^0.8.4+5
  • google_sign_in: ^4.0.1+3
2
Did you tried to run pod install directly ? Also if you try to run on real device you should check your signing config. - danypata
I tried with pod install manually but it didn't work, I'm running in the emulator - Daniele
Try to uncomment this line from your Podfile # platform :ios, '9.0' - Jarek

2 Answers

3
votes

I had a similar issue, while using Flutter on the stable channel. While running on iOS simulator I started to get this error: /[pathto]/Flutter/testtwo/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: 'Flutter/Flutter.h' file not found #import <Flutter/Flutter.h>

The only thing that helped was to change the channel to beta (I actually tried to run there and it worked) and then back to stable but also pub upgrade. See below the sequence of commands. Note that after changing to a channel you need to wait to Flutter to do the build (it took several minutes for me):

flutter pub upgrade, flutter channel beta, flutter clean, run app successfully... on iOS. flutter channel stable, flutter clean.

I hope it helps.

0
votes

I had the same , I don't know what happened but my solution was :

Create a backup "iOS/Runner" plist is especially if you have some permissions or other thing stuff that..

After that in console write : flutter create . .. that create one more time your iOS folder, apparently some files inside iOS are corrupter for some ¿bug?..

ahh too,, very important , open Xcode and not copy the file googleservices.json, you need take the file and put inside runner files (NO COPY!!)

don't forget flutter clean and restart invalid android studio. good luck!