检查并运行apollo-codegen.sh是否对Apollo不起作用? [英] Check-and-run-apollo-codegen.sh for Apollo not working?
问题描述
我正在尝试在我的iOS项目中安装Apollo.我在这里按照说明进行操作: https://www.apollographql.com/docs/ios/installation.html .当我完成添加代码生成构建步骤"时,出现错误.它找不到文件check-and-run-apollo-cli.sh.错误是命令PhaseScriptExecution失败,退出代码非零."所以我检查了它给我的文件路径.似乎"check-and-run-apollo-cli.sh"不存在,但"check-and-run-apollo-codegen.sh"确实存在.因此,我将项目中脚本的最后一行更改为check-and-run-apollo-codegen.sh.但是,它仍然不起作用(再次出现命令PhaseScriptExecution失败,退出代码非零").我需要做什么? 谢谢.
I am trying to install Apollo in my iOS Project. I follow the instructions here: https://www.apollographql.com/docs/ios/installation.html. When I complete the "Adding a Code Generation Build Step," I get an error. It cannot find the file check-and-run-apollo-cli.sh. The error is "Command PhaseScriptExecution failed with a nonzero exit code." So I checked the file path it was giving me. It seems that "check-and-run-apollo-cli.sh" doesn't exist, but "check-and-run-apollo-codegen.sh" does. So I changed the last line of the script in my project to check-and-run-apollo-codegen.sh. However, it still does not work ("Command PhaseScriptExecution failed with a nonzero exit code" again). What do I need to do? Thanks.
推荐答案
我在Apollo 0.20.0上使用Cocoapods
I have the same error here on Apollo 0.20.0 using Cocoapods
因此,我使用了Apollo提供的脚本此处
So I use the script provided by Apollo here
并根据我的工作空间进行了自定义
And customized to my workspace
"${PODS_ROOT}/Apollo/scripts/run-bundled-codegen.sh" codegen:generate --target=swift --includes=./**/*.graphql --localSchemaFile="schema.json" API.swift
为我工作= D
这篇关于检查并运行apollo-codegen.sh是否对Apollo不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!