Could not get GOOGLE_APP_ID in Google Services file from build environment
This worked for me:
Make sure you add the Xcode Crashlytics build phase after Copy Bundle Resources.
This worked for me:
When install Crashlytic with Firebase, for multiple scheme, you can have error Could not get GOOGLE_APP_ID in Google Services file from build environment
. You can fix it by:
- In
Build Settings
, add a user define for file name inUser Defined
:
- In
Build Phases
, tap plus button,New Run Script Phase
above your Crashlytic build phase, and type this code to the text field. Remember to rename %YOUR_CUSTOM_PATH_TO_FOLDER% to your path to Plist files:
GOOGLE_SERVICE_INFO_PLIST_FROM="${PROJECT_DIR}/%YOUR_CUSTOM_PATH_TO_FOLDER%/${FIREBASE_CONFIG_FILE}.plist"
BUILD_APP_DIR="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
GOOGLE_SERVICE_INFO_PLIST_TO="${BUILD_APP_DIR}/GoogleService-Info.plist"
cp "${GOOGLE_SERVICE_INFO_PLIST_FROM}" "${GOOGLE_SERVICE_INFO_PLIST_TO}"
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
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