Quickstart-ios: `configureWithOptions:` results in a warning

Created on 18 Aug 2016  路  14Comments  路  Source: firebase/quickstart-ios

I'm using configureWithOptions: so that I can use my own name instead of the default: GoogleService-Info.plist like below:

let filePath = NSBundle(forClass: self.dynamicType).pathForResource("my-config-file", ofType: "plist")
let options = FIROptions(contentsOfFile: filePath)
FIRApp.configureWithOptions(options)

It looks like a harmless warning, but I get this:
Could not locate configuration file: 'GoogleService-Info.plist'

Most helpful comment

I have the same problem like the orignal poster @pritesh-eb :

When I call FIRApp.configure(with: FIROptions(contentsOfFile: path))
the Xcode console shows the messages:

<Error> [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
<Error> [Firebase/Analytics][I-ACS020006] Google App ID from GoogleService-Info.plist is empty. Please, define GOOGLE_APP_ID in GoogleService-Info.plist for Analytics to work reliably.
 <Error> [Firebase/Analytics][I-ACS025020] Analytics requires Google App ID from GoogleService-Info.plist. Your data may be lost. Google App ID has been changed. Original, new ID: (nil), ******

And further down in the console:

<Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3900000 started
<Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled

I still have to check if the error messages are wrong, or there is actually a problem, which is bad.
If I add the argument -FIRAnalyticsDebugEnable to the current scheme, I can see events coming in the DEBUGVIEW.

Does this mean everything is okay, even if I don't use this argument?

Please fix this and don't just close the issue.

All 14 comments

same stuff, but in obj-c project, I have custom named config, but i got warnings in console: [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.

Thanks! I've raised a bug for this internally, so hopefully we can get the logging cleaned up. I can confirm the output here is harmless - the check is tripped in a code path which just ensures your bundle ID and the one specified in your config match, so all that gets missed is a warning of a potential error.

You also get [Firebase/Core][I-COR000008] The project's Bundle ID is inconsistent with either the Bundle ID in 'GoogleService-Info.plist' when you use configureWithOptions: and multiple PLISTs are created and one of them is named 'GoogleService-Info.plist'.

I have the same problem like the orignal poster @pritesh-eb :

When I call FIRApp.configure(with: FIROptions(contentsOfFile: path))
the Xcode console shows the messages:

<Error> [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
<Error> [Firebase/Analytics][I-ACS020006] Google App ID from GoogleService-Info.plist is empty. Please, define GOOGLE_APP_ID in GoogleService-Info.plist for Analytics to work reliably.
 <Error> [Firebase/Analytics][I-ACS025020] Analytics requires Google App ID from GoogleService-Info.plist. Your data may be lost. Google App ID has been changed. Original, new ID: (nil), ******

And further down in the console:

<Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3900000 started
<Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled

I still have to check if the error messages are wrong, or there is actually a problem, which is bad.
If I add the argument -FIRAnalyticsDebugEnable to the current scheme, I can see events coming in the DEBUGVIEW.

Does this mean everything is okay, even if I don't use this argument?

Please fix this and don't just close the issue.

The message is not wrong. Analytics requires GOOGLE_APP_ID from GoogleService-Info.plist file. If you configure at runtime, you may lose data, especially if you have a GOOGLE_APP_ID that is different from the one in GoogleService-Info.plist since Analytics will report data to different GOOGLE_APP_IDs. This setup process has always been documented in the official documentation https://firebase.google.com/docs/ios/setup

I have a Beta build and a Release build with different bundle ids and two projects setup in Firebase.
I do this in AppDelegate:

var filePath = ""
#if BETA
    filePath = Bundle.main.path(forResource: "GoogleService-Info-Beta", ofType: "plist")!
#else
    filePath = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")!
#endif
if let options = FirebaseOptions(contentsOfFile: filePath) {
    FirebaseApp.configure(options: options)
}

The plist files are downloaded from the Firebase console, I just changed the name of of one.
As above, I get the warnning:

 Analytics requires Google App ID from GoogleService-Info.plist. Your data may be lost. Google App ID has been changed. Original, new ID: <Release-GOOGLE_APP_ID>, <Beta-GOOGLE_APP_ID>

Does analytics only work with a plist named "GoogleService-Info"? The GOOGLE_APP_ID's are both valid.

As I stated before, even if you Google App ID is valid, there is still a chance that your data might be lost if you configure at runtime due to some integration with other Firebase SDKs. If you only have Analytics SDK, you will probably be fine. The warning is to recommend you to use the static file to avoid such problem.

Hello,

I understand the problem, but what would be the workaround if someone needs a "dev" and "production" separation at compile time ?

@oursnoir
you can simply create several GoogleService-Info.plist files and put them in different directories inside a project folder, e.g.
dev/GoogleService-Info.plist
prod/GoogleService-Info.plist

and specify them in Copy Bundle Resources in Build Phases for each target

Thanks for this neat response !

I have a project that I use to build several different products based on the Build configuration (same target though). Since you are advising against dynamically setting plist name, could you at least support a build setting that we can use to define name of the Google plist ?

@MatejBalantic I have exactly the same issue. A workaround is to have two different.plist files in the project and use a run script to rename one of them to GoogleService-Info.plist (depending on the current build configuration).
Credits to this answer: https://stackoverflow.com/a/5770672/2128900

Why was this closed? It's still a thing 3 - 4 years later.

@cargath As stated above, the warning is intended.

The related issue #230 is still open.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shingyien picture Shingyien  路  5Comments

myflashlab picture myflashlab  路  5Comments

bakeddean picture bakeddean  路  6Comments

abdulKarim002 picture abdulKarim002  路  6Comments

EthanDoan picture EthanDoan  路  6Comments