Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Error: GoogleService-Info.plist Cannot Be Found During Expo Build - [React Native]

I'm encountering a build error in Xcode when trying to build my iOS app using Expo. The error message is:

error: Build input file cannot be found: '/Users/expo/workingdir/build/.../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?

I have already added GoogleService-Info.plist to the root of my project in Xcode. Despite this, the build process seems unable to locate the file. Here are the steps I've taken:

  1. Added GoogleService-Info.plist to my project (made sure it's in the root).
  2. Ensured the file is included in the target's "Copy Bundle Resources" in Build Phases.
  3. Cleaned the build folder and rebuilt the project.

Is there a specific way I need to declare this file in Xcode to resolve this error, especially considering it's being built with Expo? Any insights or suggestions on how to fix this would be greatly appreciated!

like image 746
Relie Essom Avatar asked Oct 16 '25 19:10

Relie Essom


1 Answers

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.

  1. I opened my project in Xcode.

  2. Launch Xcode and open your project. Navigate to Your Target's Build Phases.

  3. 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:

  4. 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".

  1. 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:

  1. 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.
    
  2. 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.

  3. I then ran a new build on my expo project after cleaning my xcode build folder.

like image 158
Relie Essom Avatar answered Oct 18 '25 12:10

Relie Essom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!