본문 바로가기
iOS/Issue

[Error] Could not get GOOGLE_APP_ID in Google Services file from build environme

by Callie_ 2023. 11. 10.

⚙️ Setting

- iOS 17 ↑
- Swift vesrion 5.9
- Xcode version 15
 

💻 Trouble 

- While testing Firebase Messaging, I encountered an error message stating "Could not get GOOGLE_APP_ID in Google Services file from the build environment."
 

✏️Trouble Shooting

- Checked that the bundle ID matches the one saved in Firebase; confirmed it matched.

- Downloaded the GoogleService-Info file multiple times to ensure correctness, considering previous experiences with file naming.
 
- Although I no longer have a screenshot of the error, it pointed to the "run script" as the potential cause.
 

 
- Identified the problem in the [Run Script] - [Input Files] section. Noticed that when adding the [Run Script], I did not remove `$(SRCROOT)/` from the existing `newInputFile` before pasting Firebase Input Files. The paths were initially set as `$(SRCROOT)/newInputFile` and `$(SRCROOT)/${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}.`

- Removed `$(SRCROOT)/` from the "Input Files," and this solved the error. The issue was caused by combining two roots, confusing Xcode about the location of the GoogleService-Info file.
 
 

✅ $(SRCROOT)/newInputFile?

 
➔ `$(SRCROOT)` represents the path to the location of the `.xcodeproj` file.