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

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.

Related

Firebase connection is not working with my IOS App

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.

Xcode IDE crashes when performing any action

I can launch an Xcode project, but the second I try to do anything, e.g. toggle automatic signing, link a library, even change the build number or ANYTHING, Xcode crashes. The only hint I get as to why is this error on "Xcode quit unexpectedly"
UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[PBXFileReference realReference]: unrecognized selector sent to instance 0x7fbc8f52ee10
Something is corrupted. I thought it was related to the pbxproj file I don't know if that's the case. There are no merge conflicts. Does anybody have any clue as to what is happening? I want to rip my hair out but I'm bald.
Things I've tried:
Updating my system software
Deleting and reinstalling Xcode entirely
The status quo of deleted Derived Data and cleaning the project/builds
Note:
Other Xcode projects are launching fine and I am able to navigate the
IDE. It's only this project.
It seems to be Xcode version agnostic. So far I've confirmed it crashes when changing anything on Xcode 9.4.1 and 8.3.3.
I can provide additional context around the project upon request.

Swift Crashlytics without cocoapods and fabric API Key not showing dashboard or any data

I have implemented firebase Crashlytics in my swift projects without cocoapods. I have done the following task so far. But still, not getting anything on the dashboard.
Created project in firebase console. Downloaded the plist file and added to project.
Added the firebase library all with Firebase.h header file. Then added the header with an Obj-c bridge header file from settings. Also fabric and Crashlytics library.
Added the run script.
In appdelegate, didFinishLaunchingWithOptions() , added these 3 lines.
FirebaseApp.configure()
Fabric.sharedSDK().debug = true
Fabric.with([Crashlytics.self])
In a viewcontroller, added the following line, run on the simulator, make a crash, relaunch the apps. So that I can expect it to upload on the dashboard. Nothing found in the log, just see firebase enabled. Crashlytics version ...
Crashlytics.sharedInstance().crash()
From project settings i set , Debug Inforation Format : DWARF with dSYM File
But I see nothing on the dashboard. I don't use any API key in my Plist, I just using the plist in my project. What could be my problem?
I think I know what the issue is. You're probably running in the Simulator with the debugger attached.
Crashlytics can’t capture crashes if your build attaches a debugger at launch.
Docs for forcing a crash: https://firebase.google.com/docs/crashlytics/force-a-crash
To fix this, go to your app in the Simulator w/o the debugger attached and reproduce your crash. You should see your crash in the Firebase console.

SIGABRT Error due to FirebaseApp.configure()

Whenever I download the Google info plist file to my project and put it just under the infoplist, use pod init, set the pod 'Firebase/Core' etc., add the configure function to my AppDelegate after importing Firebase, I get the error "Thread 1: signal SIGABRT". I've tried everything, created another simple project, which was treated the same way as the main one and I still got this error, which signifies that the origin of the error comes from "FirebaseApp.configure()". Please, help me, I'm literally dying.
Happened to me too but my issue was not the target.
How i solved my error was that i ensured that the app is part of a firebase project. Downloaded the latest GoogleInfo.plist file and replaced the one that was already in the project and it no longer crashed again.

Switching Firebases in a Swift project

I accidentally added the wrong Firebase (let's call it OLD) to my Swift project, so today I went through the process of adding the correct one (NEW) instead. I deleted the old plist config file and added the new one, but when I run the app, I get an error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Provided bucket: OLD.appspot.com does not match bucket specified in FIRApp configuration: NEW.appspot.com'
In the GoogleService-Info.plist file, the STORAGE_BUCKET field correctly is NEW.appspot.com, and OLD.appspot.com doesn't show up anywhere. So how can I resolve this?
I have had this problem while dealing with two iOS accounts so I would expect the answer to be similar.
The primary reason is that the old user has been cached to your device. This means that each time you login with the newer one is errors due to expecting the old user which is set up on the previous url. Frustratingly deleting the app, cleaning the app, calling pod update, logging in on the new version and calling logout etc don't seem to have any affect on the problem.
This seems to occur when the user has logged and then a new version with a different url is loaded over the top.
The only way I managed to fix this was to reset the app to its previous settings (put back the OLD firebase url and also the OLD.plist google services file). Load up the app and then logout of the app, this should remove the cached user settings. Now when you load up with the new settings it should not log into the previous user (depending on your auto login app settings) and should allow you to successfully log into the new account.
While doing this remember to download the new .plist file and also make sure the correct bundleID and firebase url are entered.
NOTE: If you are experiencing this problem on the simulator I think you can reset the content and settings. This is found in
Simulator -> Reset Contents and Settings...
Hopefully this helps
I was able to fix this via checking my GoogleService-Info.plist.
If you've used the .plist file multiple times, make sure you've added the right one to your project.
You can always go back to your Firebase console.
Click on the settings icon next to Overview.
Click on Project Settings, choose the app you'd like to download the .plist file for.
Doing this will solve any issue...

Resources