amplify-swift: New iOS project build failure
Describe the bug Following along with Amplify iOS Getting Started after creating the workspace and attempting to build it is failing on PhaseScriptExecution.
To Reproduce Steps to reproduce the behavior:
- Create a new single view Swift project (storyboard)
- Create a Podfile following the steps in the tutorial Step 1
- Install the pods:
pod install --repo-update - Open the new workspace and attempt to build
- Get the following error:
/bin/sh -c /Users/username/Library/Developer/Xcode/DerivedData/AmplifyPrac-bealbahytjoipvfcoytbyzyythmp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/amplify-tools.build/Script-A25A17163ECF22B928D19C9FEBC62DAB.sh
/Users/username/Library/Developer/Xcode/DerivedData/AmplifyPrac-bealbahytjoipvfcoytbyzyythmp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/amplify-tools.build/Script-A25A17163ECF22B928D19C9FEBC62DAB.sh: line 3: npm: command not found
warning: Node is not installed. Vist https://nodejs.org/en/download/ to install it
/Users/username/Library/Developer/Xcode/DerivedData/AmplifyPrac-bealbahytjoipvfcoytbyzyythmp/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/amplify-tools.build/Script-A25A17163ECF22B928D19C9FEBC62DAB.sh: line 18: amplifyxc.config: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
It is also giving the mistaking warning that node was not found.
% which node
/Users/username/.nvm/versions/node/v12.16.0/bin/node
% node --version
v12.16.0
% which npm
/Users/username/.nvm/versions/node/v12.16.0/bin/npm
% npm --version
6.13.4
Expected behavior Building the project should result in a successful build and the 3 files the tutorial talks about should be generated.
Environment(please complete the following information):
- Amplify Framework Version: 4.14.1 (amplify --version)
- Dependency Manager: Cocoapods
- Swift Version : 5.1.3 (swift --version)
- Xcode Version: Version 11.3.1 (11C504)
Device Information (please complete the following information):
- Device: iPhone11, Simulator 11, 11 Pro
- iOS Version: iOS 13
- Specific to simulators: No simulators and real device is effected.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (1 by maintainers)
@detectedstealth @buffpojken This is an issue when using zsh as the default shell. As a workaround, you can run
npx amplify-app --platform iosin the root of the project and the rest of the steps in the documentation should work as expected.@detectedstealth yes this is an issue with nvm not being loaded through Xcode’s non-interactive shell.
As for the named profile, please update
profileinamplifyxc.configto your desired named profile ifdefaultis not configured.We will look into ways to loading different shell profiles through Xcode as well as updating the docs to make this flow clearer.