Apollo-ios: Build phase script: No such file or directory error

Created on 20 Nov 2017  路  7Comments  路  Source: apollographql/apollo-ios

When I try to compile using the build phase script in the guide, I get the following error:

.../Build/Products/Debug/Apollo/Apollo.framework/check-and-run-apollo-codegen.sh: No such file or directory

If I change the path in the build script from:

$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output API.swift
to:

$APOLLO_FRAMEWORK_PATH/Versions/Current/Resources/check-and-run-apollo-codegen.sh generate $(find . -name '*.graphql') --schema schema.json --output API.swift

It builds without error.

Most helpful comment

@cczufish The script has been renamed after codegen has been incorporated into the new Apollo CLI. See here for the correct build phase script.

All 7 comments

Ah, is this with a Mac target by any chance? The framework directory structure is different between iOS and Mac, so that would explain this.

Yep, absolutely. That makes sense. It's working fine with the workaround above. Any reason you know of why I shouldn't leave it like that?

No reason at all! This is how it is supposed to be set up on Mac. In fact, this should really be in the documentation.

Super! Thanks for the lightning quick reply!

I have a problem when I add build phase script ,

/Apollo/Apollo.framework/check-and-run-apollo-codegen.sh: No such file or directory

why

@cczufish The script has been renamed after codegen has been incorporated into the new Apollo CLI. See here for the correct build phase script.

@cczufish
Expand Generate Apollo GraphQL API in Build Phases
Replace ["${SCRIPT_PATH}"/check-and-run-apollo-cli.sh codegen:generate --target=swift --includes=.//.graphql --localSchemaFile="schema.json" API.swift]
to ["${SCRIPT_PATH}"/run-bundled-codegen.sh codegen:generate --target=swift --includes=./
/.graphql --localSchemaFile="schema.json" API.swift]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uericw picture uericw  路  4Comments

designatednerd picture designatednerd  路  3Comments

maxsz picture maxsz  路  4Comments

jeromeDms picture jeromeDms  路  5Comments

marcoreni picture marcoreni  路  3Comments