Unable to build flutter app with firebase auth in Xcode - ios

I'm building a flutter mobile application with firebase_auth to authenticate. It's run well on android. But when i'm try to build it on ios using xcode it gives me series of erros.
I have added the GoogleService-info.plist file inside Runner folder using xcode and added the Firebase.configure() code potion in AppDeligate.swift file. But still not working for me.

Actually if you are develop your iOS app with Flutter you cant build in Xcode. You have to build with Flutter.
flutter clean
flutter build ios
Then
Xcode -> Product -> Destination -> Any iOS Device
Xcode-> Product -> Scheme -> choose scheme -> Runner
Xcode-> Product -> Archive
Or
flutter clean
flutter build ipa
then
Xcode-> Product -> Archive

Running in Xcode
First make sure to run pod install in the ios directory: cd ios; pod install
Then in Xcode, clean (Command + Shift + K) & rebuild (Command + B).
Running using flutter cli
Flutter CLI will make sure to run pod install for you. So it should work just by runnning flutter run or flutter build

Xcode errors almost never have singular answers
Add the GoogleService-info.plist file into your Xcode project by
right-clicking on any file inside the Runner folder within the file
Navigator pane (select add files to project and then add the
GoogleService-info.plist into the project). This process will make
sure that the Xcode project sees the file.
Make sure you enable the internet permission in the project.
You can install and use the pod deintegrate tool (src); with that tool you will be able to easily reset your Pod environment. A Google search can also give you others ways to reset the cocoapod environment. After which you'd want to pod install to ensure you get the latest versions of everything.
Make sure you address the pod warnings that usually appear. They might ask you to change your debug configuration to the Pods.debug reference for example.
flutter build ios will create any flutter specific files that might be missing so running this command in terminal from your project root folder is a great idea.
Another often missed opportunity is to just go into your root project and dump the (ios, macos, android, etc.) folder completely. Then use flutter create . from the project root folder to recreate the iOS folder before running flutter build then doing the normal sequence of getting Xcode ready.
In Xcode:
Open the workspace file not the Project file (we should see both
Runner and Pods in the screenshot provided and I don't see that in
yours)
Ensure that the project is signed
On the Runner project change the debug configurations to the Pods.
Add the Google info file into the iOS folder
Add the Google info file into the project workspace from within Xcode
NOTE:
I expect to see the Pods Project when you open the Runner.xcworkspace
file. If not, make sure you are opening the workspace file, close
Xcode and regenerate the pods from the iOS folder using pod install
or from the root folder run flutter build ios.

Related

how to slove 'Flutter/Flutter.h' file not found in xcode

Flutter not found that type of error in Xcode for build application,I have try to schema in flutter but it could not build the app and Xcode could not build the IOS Application , so how can i Solve this i have already use flutter clean and flutter pub get to solve this but it could not build the app
Delete pods folder, .symlinks folder, Podfile.lock then navigate to ios folder. Run pod install. Then build from xcode. Make sure you have enough space on your machine to build it too

Error when trying to open cloned project in xcode: "Could not open file"

I want to create an iOS build for my cordova app. For this i must use Xcode. I cloned the repository and tried to open it using File > open > path but I always get the following error:
The project does not have any .xcodeproj or other xcode-related files in it because it was not developped in Xcode.
What I've tried already:
I also tried opening xcode from the terminal inside the project-directory but that resultet in the same error.
Restarted the Mac and Xcode.
Logged out of my Apple- and GitHub accounts in Xcode and logged in again.
Deleted all of the DerivedData files and iOS Device Logs
I'd be very glad if someone could help me.
If you look at https://cordova.apache.org/docs/en/11.x/guide/cli/index.html, there are steps how to create a project for iOS.
Here is a snapshot:
Add Platforms
cordova platform add ios
cordova platform ls
Build the App
cordova build ios
That should create an Xcode project.

Why does xCode cannot build my flutter app with 'sqflite' not found error

I'm trying to build my Flutter app for iOS using xCode and got error:
.../ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'sqflite' not found
When I'm trying to build application with flutter with command
flutter build ios
I don't have any problem. Application build successfully.
I tried to delete Pod directory in ios folder and then install pods from scratch
flutter pub get
pod install
How to fix this problem with xCode?
XCode gives this type of Error like Module 'something' not found, when sometimes the problem is somewhere else.
So, what I did is after running flutter build ios command, I didn't try to run it in XCode. Because it was giving these errors.
So, I archived the app and tried to publish in App Store Connect. Then I found the real issue/bug on my code.
App store doesn't support transparent logo or app icon. This was the bug in my case.
So you can try to archive and publish to app store connect. It may show you the real reason.
Change your target Destination to > Any iOS Device
This work for me
"I found the solution,
In the existing project, once you guys add sqflite dependencies
Profile file in IOS folder will not generate code
we need to remove Podfile in ios
rm ios/Podfile
and run the project again, it works for me."
Credit:thanks to viroth-geek

Ionic Xcode unable to open file(target app)

I haven't touched my Ionic projects in around 1-2 months.
All my projects were running perfectly then.
I go to try run them today and every single one of them is saying
Showing Recent Messages
/Users/jakelewis/Desktop/fifteen-project-e/ios/App/Pods/Target Support
Files/Pods-App/Pods-App.debug.xcconfig: unable to open file (in target "App" in project "App")
They were all running perfectly. I haven't updated Xcode yet to the latest because it's still in the process of downloading. What would cause this issue?
It's a nightmare.
Somethings I tried, removing the ios folder and npx cap add ios
Even went on GitHub and went to rollback versions I knew that ran perfectly on IOS before.
I am using capacitor on most of my projects.
This did not fix the issue.
close XCode
run ionic capacitor copy ios to build it.
run pod reintegrate and pod install (navigate to where the pod file is located first, ex: cd ios/App and then run "pod install" command)
open XCode again use ionic capacitor open ios command
This work for me
try this:
Close XCode
open a terminal, go to the project and execute
pod install inside your app folder (where Podfile is located)

Flutter, Cannot Build For iOS: Missing .h-Files

Building our Flutter project fails on iOS. The following steps work without problems:
running on the XCode simulator (flutter run)
building in the terminal (flutter build ios)
running on a real device in debug mode (flutter run -d "abcd")
If I open the project in XCode, change the build target to "Generic iOS Device" and hit "Build" or "Archive" I get the following error:
/Users/.../development/testproject/ios/Runner/GeneratedPluginRegistrant.m:6:9: 'flutter_exif_rotation/FlutterExifRotationPlugin.h' file not found
After removing the FlutterExifRotationPlugin, the error reoccurs with the next plugin alphabetically, so I figured that plugins in general don't work at the moment.
I tried:
dev, stable and master channels of flutter
reinstalling XCode
reinstalling Flutter
create a new project and moving the old files there
But nothing worked so far.
Ok the solution was very simple. I had to open the .xcworkspace file instead of the .xcodeproject one.
One WEEK went down the pipe for this error. I hope that you, future reader, will find this comment useful.

Resources