expo / eas-cli

Fastest way to build, submit, and update iOS and Android apps
https://docs.expo.dev/eas/
MIT License
828 stars 84 forks source link

error: Build input file cannot be found: GoogleService-Info.plist React Native - Expo eas build IOS #2199

Open opielapatryk opened 9 months ago

opielapatryk commented 9 months ago

Build/Submit details page URL

https://expo.dev/accounts/patrykopiela/projects/stickyinreactnative/builds/a730b9bb-c72d-4bc8-b620-a6b70b9d7f39

Summary

Since few days I am trying to fix this error: ❌ error: Build input file cannot be found: '/Users/expo/workingdir/build/GoogleService-Info.plist'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'StickyInReactNative' from project 'StickyInReactNative')

I tried every solution found on internet but nothing helps!

Managed or bare?

Bare

Environment

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check npm/ yarn versions ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that native modules do not use incompatible support packages ✔ Check for legacy global CLI installed locally ✔ Check that native modules use compatible support package versions for installed Expo SDK ✔ Check that packages match versions required by installed Expo SDK

Didn't find any issues with the project!

Error output

❌ error: Build input file cannot be found: '/Users/expo/workingdir/build/GoogleService-Info.plist'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'StickyInReactNative' from project 'StickyInReactNative')

Reproducible demo or steps to reproduce from a blank project

After clone project from github I have to

comment firebase pods cd ios && pod install uncomment firebase pods pod install

then I use for build: eas build --profile development --platform ios

szdziedzic commented 9 months ago

Do you have it git ignored by any chance?

karimessouabni commented 9 months ago

I had the same issue. I did add it to my git ignore. I still can't get it why does the git ignore is used when running an eas build --local

rinaldycodes commented 8 months ago

i was facing this issue, if you want using GoogleService-Info.plist, you must not add GoogleService-Info.plist file in .gitignore . because in eas build need that file. you can check it https://docs.expo.dev/build-reference/variables/

MariuzM commented 8 months ago

Got into the same issue, wish there was another way to still have it in gitignore but able to build locally

hisayan commented 7 months ago

I faced the same issue and I solved by this script.

.gitignore

GoogleService-info.plist

package.json

"scripts": {
    ...
    "eas:preview": "EAS_PWD=$PWD npx eas build --profile preview --platform ios --local",
    "eas-build-pre-install": "cp $EAS_PWD/GoogleService-info.plist $EAS_BUILD_WORKINGDIR"
}
$ npm run eas:preview

and I also copy .env file.

"eas-build-pre-install": "cp $EAS_PWD/GoogleService-info.plist $EAS_BUILD_WORKINGDIR && cp $EAS_PWD/.env $EAS_BUILD_WORKINGDIR"
ndav commented 3 months ago

I had the same issue. I did add it to my git ignore. I still can't get it why does the git ignore is used when running an eas build --local

I would completely agree with this. I've just been banging my head against a wall for 2 days only realising that .gitignore is used for a local build! It makes no sense whatsoever, whatever is on the filesystem should be considered available

fernandatoledo commented 3 months ago

if your .env is in your gitignore that solution would not work, right? @hisayan

renerpdev commented 2 months ago

I had the same issue, either on Expo CI or locally. The problem I faced was that the EAS bundler omitted all GoogleService-info.plist files (at the root level or inside the ios folder) because I added that entry to .gitignore. Yeah a dummy dev issue xD

The fix was to force it only to exclude the one from my root ;)

# .gitignore (See I prepended it with a backslash)

\GoogleService-info.plist

I also needed to grab the env variables using dotenv-cli

Here is my command to build it locally

dotenv -- eas build -p ios --local
dearlordylord commented 1 month ago

does it mean we have to check GoogleService-info.plist into the repository?

alexandrubeu commented 1 month ago

Quick question, is there a way to have GoogleService-Info.plist uploaded to expo services in the secrets section? Currently I'm trying to that but when I'm trying to build directly on expo services says that I needed locally in order to trigger the build. Using this command: eas build --profile dev:debug --platform=ios --non-interactive

renerpdev commented 1 month ago

does it mean we have to check GoogleService-info.plist into the repository?

Hi @dearlordylord I didn't need to add it to git, I just created env vars either on local or CI envs