Firebase connection is not working with my IOS App - ios

Hey I wanted to connect Ios App to Firebase, I did everything like in the documentation on the website but when I do the last step and want to run the App to connect with the firebase server, it is crashing and this message comes: Thread 1: Exception: "`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/."
But Why? I have it downloaded and integrated into my project, everything looks like in all the tutorials but it's not working...
And when I open the old blue Xcode project it is throwing this error:
Here are the references of the new white project, you can see that I have everything:
I would be really thankful if someone could help me! I just want to go ahead and work on the app:(

The error clearly says that it could not find a valid GoogleService-Info.plist , rename your file from GoogleService-Info-2.plist to GoogleService-Info.plist and then it should work.

Related

Why does my Flutter app crash at startup on iOS?

I'm trying to build a simple app using Flutter for iOS and Android, but the app crashes on startup when I try to run it on an iPhone (Android runs fine). I don't have a mac, so I'm using Codemagic to compile a release build and deploy to TestFlight, then installing on an iPhone from there. Apple only shows their crash logs in Xcode as far as I can tell (nothing in App Store Connect online?), and since I don't have a mac, I can't see those. Any thoughts as to what I might be running into, or what information I can gather to debug the problem?
Thanks!
Edit: I've been digging around some more and it looks like the crash is related to the Firebase dependencies. If I create the Flutter demo project (flutter create ), it runs fine on iOS. However if I then add Firebase packages to pubspec.yaml, and manually add GoogleServices-info.plist, the app crashes on startup. (I'm not adding any code that uses Firebase yet.) GoogleServices-info.plist is supposed to be added with Xcode, but since I don't have Xcode or a mac, that makes it tough. The second answer to this question gives a suggestion: Where to save GoogleService-Info.plist in Flutter without Xcode?
I tried making those changes but got the same result. Anybody have any recommendations for adding Firebase without a mac?
Ok, so here's what happened. Originally the app crashed on iOS because there were issues with the GoogleServices-info.plist file (probably). There were no error messages, so I didn't know where to look. I finally just went back to the simple demo app and started layering things back in to isolate the issue. The demo app would build and run on iOS with no problems, but when I added the Firebase dependencies (as a group), it failed. I had added the GoogleServices-info.plist file manually (outside of Xcode) and adjusted the references in ios/Runner.xcodeproj/project.pbxproj using a text editor, but that didn't do the trick.
At this point I finally broke down and got a MacBook. Debugging on the Mac, I could now see that the app crashed in debug mode on the emulator as well as when in release mode on a device, but still no helpful error messages. I added the GoogleServices-info.plist file using Xcode, so at least that piece was correct, but the app still crashed immediately. Going through the documentation, I realized that when I made the sample app, I had forgotten to add the app ID in the info.plist file for AdMob. At this point it was just AdMob causing the crash, not the other Firebase dependencies. I added that back in and things ran fine. I wish I had looked at that a month ago. Ugh.
Thanks #Mikhail Tokharev and #season for taking a stab at such a vague question. I wish I had more detail to share initially, but I didn't know enough yet to know what could be going wrong.
TL;DR
Just get a Mac. Trying to debug through Codemagic won't work.
For Firebase, be sure you actually add your GoogleServices-info.plist file through Xcode. Trying to add it manually and hack the project.pbxproj file probably won't work (this a practical recommendation, I didn't prove this conclusively).
https://firebase.google.com/docs/flutter/setup?platform=ios#add-config-file
For AdMob, be sure to add your application ID to the info.plist. https://pub.dev/packages/firebase_admob
I've been facing this error since the last few days and I happen to solve it today. So, I would like to share it with anyone facing startup error after connecting their iOS app to firebase.
I had followed all the steps while setting up a new iOS app with firebase and this was what exactly caused the error, in my case. If you have placed import 'Firebase' and Firebase.configure() in your AppDelegate.swift, then remove it and run your app again. I removed those two lines and it worked fine. Test it with Cloud Firestore (just make a button write something to your cloud firestore) and make sure you add await Firebase.initializeApp(); as well when the button is pressed.
I did all of those steps and it worked fine with me.
P.S. I did it with android studio in a Mac.
For any newbies out there like me, make sure registering firebase is before GeneratedPluginRegistrant in your ios/Runner/AppDelegate.swift file.
// This works without crashes, FirebaseApp.configure() after GeneratedPluginRegistrant crashes
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
i had the same issue and i have fixed it as i was new to ios deployment i forgot to add capabilities which indeed crashed my app in testflight ...so please be sure you have added required capabilities in signing and capability tab in xcode
use terminal to run the app.
run this command
flutter run --release
For iOS: In our case this happened because of Facebook plugin update.
Previous version: flutter_facebook_auth: ^3.5.1
New Version: flutter_facebook_auth: ^4.3.3
We were missing FacebookClientToken in Info.plist file. So after adding that it worked.
<key>FacebookClientToken</key>
<string>$(FACEBOOK_CLIENT_TOKEN)</string>
most probably you've faced with next Flutter issue https://github.com/flutter/flutter/issues/54707
I had the same problem and solved it as below :
In the folder of flutter sdk,
I did git pull then run the app again and it was solved .
If you using Google Firebase library in flutter app
Make sure use FirebaseApp.configure() before GeneratedPluginRegistrant.register(with: self) in AppDelegate.swift file.
FirebaseApp.configure()
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)

How to use Swift Pod in Unity exported iOS App

I have reach experience in iOS native app development, My company have a unity app. Unity app developer exported the app for iOS and shared with me. I wanted to use my own created cocoa-pod library (which I have already using in my another iOS App) into Unity iOS project.
So Unity developer exported by File -> Build Settings, choose iOS and click Build, and now I am trying integrated pod (which is written in Swift 4.2) into Unity exported of iOS project.
I have taken medium post and many more reference, I have implemented the same as conclusive direction. Please look the attached screenshot below.
Reference - https://medium.com/ios-os-x-development/swift-and-objective-c-interoperability-2add8e6d6887
Please look the below screenshot for autogenerated file
Now when I am going to import this autogenerated header file to make connection between Objective C to Swift, then it is showing error as attached screenshot below
Please help me to resolve this issue. Thanks in advance.
One thing that has hung me up on this in the past is if you get an error during the initial build, then sometimes it doesn't create the -swift.h file and then subsequent builds also get an error that it's missing. Make sure you've deleted your derived data and cleaned the build folder to reset so everything gets built from the beginning.

'Branch.h' file not found Xcode error for Ionic 3 app

When I am trying to build my Ionic 3 app in ios device from Xcode, I am getting the following error.
'Branch.h' file not found
The error appears in file BranchSDK.h inside the Plugins folder of IOS.
There are old threads on Github regarding this error but I am unable to solve it.
Please try following solution:
Please make sure that you are opening xcworkspace instead of xcodeproj.
Please remove the existing SDK integration, start a fresh and make sure to use the latest version. You can follow this link for more details:
https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/issues/356
Delete derived data from Xcode as suggested in this link.
Config.xml is an important part of your project configuration, please make sure to cross confirm it from the Branch Dashboard. Please follow our troubleshooting guidelines to make sure you are not missing anything.
In case following solution does not works for you please write to support#branch.io.

New to Firebase and swift. Having trouble connecting Firebase to Xcode

So I am new to swift and xcode so please have mercy. So basically I am trying to connect my project in xcode to Firebase. I am using a blank single view application template and have not bothered with adding any buttons or more view controllers. I am just testing it and trying to connect it to Firebase. So the problem I am having is is the app succeeds in compiling, but then as soon as the application opens in the simulator, it gives me a Thread 1: signal SIGABRT error. I don’t know what I am doing wrong. I have followed all of the installation instructions correctly. I went to Firebase and configured the app with the bundle indentifier. I added the Google-Service.plist file into xcode. I succesful installed all of the pods into my project. I go into the app and add
import Firebase
FIRApp.configure()
into the delegate swift file. I save the project and close it. I open the app workspace file (the one it recommends to open) And then without adding anything to the project or adding any user interface options, I immediately run the project, it says build succeed and then instantly crashes and gives me the Thread 1: signal SIGABRT error. Does anybody have any ideas of what this is? I don’t know what I am doing wrong. I can’t move forward with swift and firebase if I can’t even configure it correctly. Can you please figure this out?
Here is the description of the error it gives me:
TestAppWithJack[71791] <Error> [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2017-01-14 17:06:19.456 TestAppWithJack[71791:2160021] *** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure] could not find a valid GoogleService-Info.plist in your project.
Did you make sure that the google plist is specifically called GoogleServices-Info.plist? If it isn't specifically that name, then it won't work.
Where did you put GoogleServices-Info.plist? If you dragged it to the wrong place, that could be why it was giving this error because it cannot find the file... Drag GoogleServices-Info.plist under your info.plist it should be fine then.

Firebase Crash Reporting iOS - Unreadable Crashes - Upload Symbol Files?

I'm trying to integrate Firebase Crash reporting for my iOS app. I am using Xcode 8.1, Swift 3 and the latest Firebase Crash reporting version as of 29/11/16.
I have installed Firebase Crash reporting via Cocoapods and have I gone through the limited setup guide from the documentation shown below where I added a run script with my Google App ID and the path to my Google Crash Key son file (Service account)
Replace this with the GOOGLE_APP_ID from your GoogleService-Info.plist file
GOOGLE_APP_ID=1:my:app:id
Replace the /Path/To/ServiceAccount.json with the path to the key you just downloaded
"${PODS_ROOT}"/FirebaseCrash/upload-sym "/Path/To/ServiceAccount.json"
I am not sure if I have implemented the second step correctly. I did this
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}/******/GoogleCrashKey.json"
The problem I have is that my app crash reports are pretty unreadable. I believe I either need to upload a symbol file or I have got the second step wrong.
How would I upload the symbol files for crash reporting. I get this instruction when pressing the upload symbol file option in the Firebase Crash reporting console. However I am unsure how to implement it.
1: Using the command line, navigate to your Xcode project folder and run the following:
./Pods/FirebaseCrash/batch-upload < service-account-file > my_UUID
Any help would be great.
Thank you
I was making a mistake when I was trying to implement the second step. I had the Speech marks in the wrong place and had the whole file path as a string :(.
instead of doing this:
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}/******/GoogleCrashKey.json"
I changed it to this:
"${PODS_ROOT}"/FirebaseCrash/upload-sym "${SRCROOT}" /******/GoogleCrashKey.json"
My crash report now looks like the following:
Thanks for the help Martin. Much appreciated.
I had the same problem with the Firebase log - a bunch of unreadable information. After adding the symbol file, it worked fine.
Just in case someone is wondering how to add the symbol file, here is the link.

Resources