问题
hi I'm trying to include firebase in my app and followed the documentation, when I'm trying to do google sign in, Could not configure Firebase InstanceID error occurs .please advice how to overcome this error
回答1:
You have to add your project which is created on
https://developers.google.com/mobile/add?platform=ios or fire base console into your Firebase dashboard.
Now you can download GoogleService-Info.plist from Firebase and import into your project.
回答2:
There are two things to check (and hopefully, one will fix it for you):
- Make sure your BundleIdentifier is exactly the same in your Firebase project as it is in your Xcode, i.e. com.[yourcompany].[yourappname]
- Make sure you got the latest GoogleService-Info.plist file. Go to Firebase Console -> Settings -> Your Application - there will be a blue button to the right that lets you download new configuration file
That solved it for me.
回答3:
Bug Details
As of version 3.13.0, there appears to be a bug in the Firebase/Core SDK.
I added a symbolic breakpoint at -[FIRInstanceID(FIRApp) configureInstanceIDWithOptions:app:] and stepped though the assembly.
It appears that FIRApp.configure() is ignoring the IS_GCM_ENABLED flag in the GoogleServices-Info.plist and tries to configure GCM regardless of the flag's state. In my case, because my project does not use GCM, the app would crash because there was no GCM_SENDER_ID in the plist.
Workaround
Add a dummy value (i.e. 123456789012) for GCM_SENDER_ID within the GoogleService-Info.plist file. This will allow the application to configure successfully.
回答4:
I setup Firebase in code using FIROptions. In my case, I was missing gcmSenderID, fixing it then it works
回答5:
Firebase DevRel here. This should be an error, unless you enabled gcm, you shouldn't go through instanceid setup. Filed internally.
For now, the workaround is manually changing "IS_GCM_ENABLED" to "NO" in your "GoogleService-Info.plist" file
回答6:
I was getting this error as I didn't have my GoogleService-Info.plist in my Test folder as well. ( if you are using TDD)
As of the latest Firebase Core 3.16.0 - I seem to need to include it in my main project as well as copying a version into my Test Root.
回答7:
This also happens when you shift your google SDK integration from one account to another and don't edit the API keys on application side.
Make sure when you shift from one google account to another, you re-visit all the SDK guides again like FCM, Google Sign-in etc and make sure you are using new API keys (client_id, URI Scheme) in application.
来源:https://stackoverflow.com/questions/38637967/could-not-configure-firebase-instanceid