iosswiftfirebasecrashlytics

Could not get GOOGLE_APP_ID in Google Services file from build environment


For setting up firebase i am using two config 1.GoogleService-Info-test.plist, 2.GoogleService-Info-prdn.plist for UAT and Production. For installing crashlytics using firebase i have followed firebase documentation https://firebase.google.com/docs/crashlytics/get-started?authuser=1#ios. But when i try to run, it throws error in build phase while running script.

I tried without changing config file name and it worked.

Error msg at build phase while running fabric run script "Could not get GOOGLE_APP_ID in Google Services file from build environment".

Can anyone suggest better solution to achieve my requirement.


Solution

  • This is one way you can do it, by having your projects environments separated by targets, by doing so you can then add your different plist files and just check the target that they belong to, that way when you compile the target it will take it's corresponding plist file

    Sample Image

    Another way to do it, or to look up how to do it, it's called multiple environments with firebase, here are some helpful links

    Use different GoogleService-Info.plist for different build schemes

    https://medium.com/rocket-fuel/using-multiple-firebase-environments-in-ios-12b204cfa6c0