I'm trying to run an app for a client, and I keep going through this error:
The app is using a Cocoapod called Apollo, fully updated. I'm using Xcode 13.3, on a 2018 Macbook Pro
I've tried some solutions like:
- Reinstall the pod (deleting the line in Podfile, updating, adding again and cleaning the build)
- Change the script on Build Phases to match this answer
- And I searched and found schema files like this answer
- I've also read the Apollo documentation and found nothing wrong with the code or scripts in the app.
In my target BuildPhases/Run Script, I have the following code:
APOLLO_FRAMEWORK_PATH="$(eval find $FRAMEWORK_SEARCH_PATHS -name "Apollo.framework" -maxdepth 1)"
if [ -z "$APOLLO__FRAMEWORK_PATH" ]; then
echo "error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project."
exit 1
fi
cd "${SCROOT}/${TARGET_NAME}/Api/PrivateAPI"
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-cli.sh codegen:generate --queries="$(find . -name '*.graphql')" --passthroughCustomScalars --schema=schemaPrivate.json PrivateAPI.swift
cd "${SCROOT}/${TARGET_NAME}/Api/PublicAPI"
$APOLLO_FRAMEWORK_PATH/check-and-run-apollo-cli.sh codegen:generate --queries="$(find . -name '*.graphql')" --passthroughCustomScalars --schema=schemaPublic.json PublicAPI.swift