After spending a good amount of time troubleshooting this issue in my Xcode / React Native project, I finally cracked the problem related to GoogleService-Info.plist
not being found in my project.
error: Build input file cannot be found: '/Users/expo/workingdir/build/frontend/mobile/ios/GoogleService-Info.plist'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
The error was pretty annoying at first, but after some trial &. error, I managed to find a working solution.
-
I opened my project in Xcode.
-
Launch Xcode and open your project. Navigate to Your Target’s Build Phases.
-
Click on the project file (the blue icon) at the top of the Project Navigator. Select your app’s target from the list. Add or Edit a Run Script Phase:
-
Go to the “Build Phases” tab.
ATTENTION:
If you already have a script phase that should produce GoogleService-Info.plist, click on it to expand and edit the script.
If you don’t have a relevant script phase, add one by clicking the ‘+’ button at the top left of the “Build Phases” section, then choose “New Run Script Phase”.
- In the script editor area, write or modify the script that generates or modifies GoogleService-Info.plist.
MAKE SURE:
Ensure that the script writes the output file to the correct location, typically to $(SRCROOT), $(BUILT_PRODUCTS_DIR), or $(TARGET_BUILD_DIR) depending on your project structure and requirements.
Specify Output Files (Optional):
SOLUTION
Below the script editor, you may see an area to specify “Output Files” or “Output Files List”.
Here, you can add the path where the script will place GoogleService-Info.plist. For example:
-
Input the expected path of the
GoogleService-Info.plist
file, like:$(SRCROOT)/GoogleService-Info.plist // <-- If project in Root PATH.
or like
$(SRCROOT)/path/to/GoogleService-Info.plist // <-- If project in nested PATH.
-
This step, while not mandatory, turned out to be quite insightful for incremental builds. It’s a good way to let Xcode know when it needs to re-run the script.
-
I then ran a new build on my expo project after cleaning my xcode build folder.