React native build failed in iOS - PhaseScriptExecution - ios

I am facing issue in react-native project. It's working fine in android but build failed in iOS version. I have already tried all possible solution, but didn't get any solution.
The main problem is PhaseScriptExecution.
Xcode version - 12.4
Mac OS version - 11.3 (Big Sur)
npm version - 7.10.0
react-native version - 0.64.0
react version - 17.0.1
For mode detail, i am attaching the screenshot.
/Users/mmdev1/Library/Developer/Xcode/DerivedData/PRJ22-edpcityjusyktkdaxtnvzawndbxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-99DF087F7D2E061B36AA638AA7C0AD26.sh: line 4: 16519 Segmentation fault: 11 bash -l -c 'SRCS_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../Libraries CODEGEN_MODULES_OUTPUT_DIR=/Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/../React/FBReactNativeSpec/FBReactNativeSpec CODEGEN_MODULES_LIBRARY_NAME=FBReactNativeSpec /Users/mmdev1/Documents/RN/PRJ22/node_modules/react-native/scripts/generate-specs.sh' 2>&1

I was getting the same failure, and I have not been able to pinpoint exactly why this works, but in my package.json I changed
"scripts": {
"ios": "react-native run-ios",
}
to
"scripts": {
"ios": "unset PREFIX && react-native run-ios",
}
As I was seeing some issues regarding the PREFIX env variable when using Node Versioning Manager (nvm).

Related

React-native monorepo iOS release build crash

I have a monorepo with this architecture :
├── node_modules
├── packages
├── app # React native project
├── android
└── ios
├── common # TS package
└── web # Next JS project
In common package I have some shared services such as API calls for web front and mobile app.
During development phases, build and run process were working fine for both app and web.
Now I would like to publish my app to the app store but I'm not able to compile a working release ios app.
I have this crash logs when launching the app :
022-06-02 15:33:14.173898+0200 XXXX[33899:2579321] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect.
This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.', reason: 'Unhandled JS Exception: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the applica..., stack:
<unknown>#13:289
value#760:3143
<unknown>#760:747
value#760:2538
value#760:719
value#(null):(null)
'
*** First throw call stack:
(0x185361288 0x19e05b744 0x1003c0538 0x10043fd8c 0x10044066c 0x1852e9b24 0x185307610 0x18533e5fc 0x1003d7bd4 0x1003f5e98 0x1003f5ac8 0x184fc6e6c 0x184fc8a30 0x184fd0124 0x184fd0c80 0x184fdb500 0x1f6c240bc 0x1f6c23e5c)
libc++abi: terminating with uncaught exception of type NSException
I follow this article to build monorepo : https://medium.com/#ratebseirawan/react-native-0-63-monorepo-walkthrough-36ea27d95e26.
I have in my xcode project, Build Phases > Bundle React Native code and images :
set -e
export NODE_BINARY=node
export EXTRA_PACKAGER_ARGS="--entry-file packages/app/index.js --reset-cache"
../../../node_modules/react-native/scripts/react-native-xcode.sh "packages/app/index.js"
and in Start packager :
export RCT_METRO_PORT="${RCT_METRO_PORT:=8081}"
echo "export RCT_METRO_PORT=${RCT_METRO_PORT}" > "${SRCROOT}/../../../node_modules/react-native/scripts/.packager.env"
if [ -z "${RCT_NO_LAUNCH_PACKAGER+xxx}" ] ; then
if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then
if ! curl -s "http://localhost:${RCT_METRO_PORT}/status" | grep -q "packager-status:running" ; then
echo "Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly"
exit 2
fi
else
open "$SRCROOT/../../../node_modules/react-native/scripts/launchPackager.command" || echo "Can't start packager automatically"
fi
fi
In my AppDelegate.m
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:#"packages/app/index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:#"main" withExtension:#"jsbundle"];
#endif
}
metro.config.js :
const {getDefaultConfig} = require("metro-config");
const path = require('path');
module.exports = (async () => {
const {
resolver: {sourceExts, assetExts}
} = await getDefaultConfig();
return {
projectRoot: path.resolve(__dirname, '../../'),
transformer: {
babelTransformerPath: require.resolve("react-native-svg-transformer"),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...sourceExts, "svg"]
}
};
})();
Env :
react-native 0.67.4
output of npx react-native info :
System:
OS: macOS 12.3.1
CPU: (8) arm64 Apple M1
Memory: 555.95 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 8.5.0 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8092744
Xcode: 13.4/13F17a - /usr/bin/xcodebuild
Languages:
Java: 17.0.2 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
I think that the main.js bundle generated is at the wrong place but I don't find the solution, have you any idea ?
Thanks !
in your packages/app/metro.config.js file did you do the changes that are shown in the article?
also and could you share that file.
(The article that you mentioned was specifically supposed to work with ReactNative 0.63, at that time there was little to no tooling to work with React Native on a Monorepo but now we have great tooling and support for it that will solve these annoying issues out of the box, I personally have been using https://nx.dev/guides/react-native)
for your issue tho I can try to help but there might be many things that could cause the error, one might be behind the M1 chip (doesn't have to be tho)
another info that might help, I read the patch notes of RN version 0.65 or 0.66 that they fixed an issue with monorepos where metro doesn't work nicely with symlinks so that might help.
but if I where you, I would clone the NX monorepo template and see their setup and compare with what you have (Files I would look at are metro.config. info.plist. babel.config)
Atm, I found a temporarily workaround :
I added in packages/app/package.json :
"build-prod:ios": "react-native bundle --platform ios --dev false --entry-file ./packages/app/index.js --bundle-output ios/MyAppName/main.jsbundle --assets-dest ios",
in Xcode > Build Phases > Copy Bundle Ressources :
add main.jsbundle
Comment all lines in "Bundle React Native code and images" and "Start packager"
For each new release, I now need to run yarn build-prod:ios before use xcode to build.

Cannot read property 'name' of undefined on ionic build

Its my first time building an ionic app build via a Mac and its showing me flames. I have followed steps on the ionic page to do setup and build but for some reason I am having issues.
When I run ionic Cordova build iOS --prod --release
This is the error below:
Wrote out iOS Bundle Version "1.3.8" to /Users/admin/Development/App/platforms/iOS/App/App-Info.plist
Set IPHONEOS_DEPLOYMENT_TARGET to "11.0".
iOS Product Name has not changed (still "App")
Updating icons at platforms/iOS/App/Images.xcassets/AppIcon.appiconset/
Updating launch storyboard images at platforms/iOS/App/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
Updating Background Color color set Contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
Executing script found in plugin cordova-plugin-add-swift-support for hook "after_prepare": plugins/cordova-plugin-add-swift-support/src/add-swift-support.js
No scripts found for hook "before_compile".
Running command: xcodebuild -version
Command finished with error code 0: xcodebuild -version
Running command: ioreg -p IOUSB -l
Command finished with error code 0: ioreg -p,IOUSB,-l
Running command: xcrun simctl list --json
Command finished with error code 0: xcrun simctl,list,--json
Running command: xcrun simctl list --json
Command finished with error code 0: xcrun simctl,list,--json
Cannot read property 'name' of undefined
TypeError: Cannot read property 'name' of undefined
at /Users/admin/Development/App/platforms/ios/cordova/lib/build.js:145:60
at _fulfilled (/Users/admin/Development/App/node_modules/q/q.js:854:54)
at /Users/admin/Development/App/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/admin/Development/App/node_modules/q/q.js:816:13)
at /Users/admin/Development/App/node_modules/q/q.js:624:44
at runSingle (/Users/admin/Development/App/node_modules/q/q.js:137:13)
at flush (/Users/admin/Development/App/node_modules/q/q.js:125:13)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
[ERROR] An error occurred while running subprocess cordova.
cordova build ios --release --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +42ms
I have tried to do a build on a new project and samething happened. I did a build for android and its working fine on a windows machine I was doing dev on for the project.
Here is my ionic info data
Ionic:
Ionic CLI : 6.12.4 (/usr/local/lib/node_modules/#ionic/cli)
Ionic Framework : #ionic/angular 5.5.3
#angular-devkit/build-angular : 0.1100.7
#angular-devkit/schematics : 11.0.7
#angular/cli : 11.0.7
#ionic/angular-toolkit : 3.0.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 15 other plugins)
Utility:
cordova-res : not installed
native-run : 1.3.0
System:
ios-deploy : 1.11.3
ios-sim : 8.0.2
NodeJS : v14.15.4 (/usr/local/bin/node)
npm : 6.14.10
OS : macOS Big Sur
Xcode : Xcode 12.3 Build version 12C33
Thanks

react native ios build succeeds but path to app bundle is wrong

When I run react-native run-ios build succeeds and created build folder under ios. But after build, when installation starts, get the below error. The project runs successfully when I run it through xcode. What I observed is that path beginning 'DerivedData' is wrong. Instead it should be 'build'. When I rename my 'build' folder to 'DerivedData' and re-run 'react-native run-ios' the whole process completes successfully but of course with the previous build.
How can I change the 'DerivedData' to 'build'?
This error occurred immediately after I upgraded from 0.59.9 to 0.60.0.
Error:
info Installing "DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
. Run CLI with --verbose flag for more details.
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier DerivedData/Build/Products/Debug-iphonesimulator/mobileappname.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnSimulator (/Users/armaneker/WebstormProjects/mobileappname/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:189:45)
at process._tickCallback (internal/process/next_tick.js:68:7)
React Native version:
System:
OS: macOS 10.15
Binaries:
Node: 10.15.3 - /usr/local/bin/node
npm: 6.13.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Steps To Reproduce
used rn-diff-purge to upgrade from 0.59.9 to 0.60.0
android worked correctly
react-native run-ios build succeeded but installation of
app failed
The solution is not obvious, react-native-cli is trying to guess what xcode build configuration is currently setup on your computer which is what is happening on the function getBuildPath()
function getBuildPath(configuration, appName, isDevice, scheme) {
let device;
if (isDevice) {
device = 'iphoneos';
} else if (appName.toLowerCase().includes('tvos')) {
device = 'appletvsimulator';
} else {
device = 'iphonesimulator';
}
let buildPath = `build/${scheme}/Build/Products/${configuration}-${device}/${appName}.app`; // Check wether app file exist, sometimes `-derivedDataPath` option of `xcodebuild` not works as expected.
if (!_fs().default.existsSync(_path().default.join(buildPath))) {
return `DerivedData/Build/Products/${configuration}-${device}/${appName}.app`;
}
return buildPath;
}
The trick is not to patch this file, but to first setup your xcode configuration correctly Xcode > Preferences > Locations (see picture)
and Xcode > Preferences > Locations > Advanced
Once this is done, you have to cleanup your build folder, otherwise, react-native-cli will still assume that xcode is not behaving as expected, which will keep on producing the same error.
cd ios && rm -rf build
you can now execute npx react-native run-ios and everything should be fine again.
It took me quite some time to figure this out, I think that react-native-cli should output more details on what is going on under the hood for people not to be blocked.
Problem solved. I had to edit a file inside #react-native-community.
If anyone else has the same problem solution is below.
File location:
-> file:
-> node_modules
-> #react-native-community
-> cli-platform-ios
-> build
-> commands
-> runIOS
-> index.js line 314
Change:DerivedData/Build/Products/${configuration}-${device}/${appName}.app
To:build/Build/Products/${configuration}-${device}/${appName}.app
Cheers.

Podfile.lock missing when initial react-native run-ios

I am setting up IOS dev for React Native (0.61) app which has the working android version. What I did was to copy src of components and package.json file after react native environment is setup by following online post (installed xcode command line tool 10.2). But launching run-ios failed:
$ react-native run-ios
error Could not find "Podfile.lock" at /Users/mine/Documents/code/js/emps_fe6/ios/Podfile.lock. Did you run "pod install" in iOS directory?
error Could not find the following native modules: RNCAsyncStorage, RNDeviceInfo, RNGestureHandler, RNKeychain, BVLinearGradient, RNLocalize, RNReanimated, RNVectorIcons, react-native-video. Did you forget to run "pod install" ?
info Found Xcode project "emps_fe6.xcodeproj"
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error Could not parse the simulator list output. Run CLI with --verbose flag for more details.
Error: Command failed: xcrun simctl list --json devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
at checkExecSyncError (child_process.js:629:11)
at Object.execFileSync (child_process.js:647:13)
at runOnSimulator (/Usersamine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:130:54)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:100:12)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/amine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
Here is the output of react native info:
$ react-native info
info Fetching system and libraries information...
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-2675QM CPU # 2.20GHz
Memory: 194.93 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.17.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
Here is the package.json:
"dependencies": {
"#react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.11.0",
"react-native": "0.61.2",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^4.1.0",
"react-native-device-info": "^4.0.1",
"react-native-elements": "^1.2.6",
"react-native-gesture-handler": "^1.4.1",
"react-native-gifted-chat": "^0.11.3",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.3.1",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-reanimated": "^1.3.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-native-video": "^5.0.2",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.2",
"react-navigation-tabs": "^2.5.6",
"simctl": "^2.0.0",
"socket.io-client": "2.1.1",
"xcode": "^2.0.0"
},
In the error message, there mentioned quite a few modules which are missing. But those modules have been installed as it shows in the package.json. I am not sure about what the error message means. Also I installed the simctl but scrum simctl still can not find it. I am using VS Code as IDE.
UPDATE:
created an empty Podfile.lock under /ios, the error becomes when run-ios:
error Cannot read property 'SPEC CHECKSUMS' of undefined. Run CLI with --verbose flag for more details.
TypeError: Cannot read property 'SPEC CHECKSUMS' of undefined
at getDependenciesFromPodfileLock (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js:63:58)
at warnAboutPodInstall (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js:43:67)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:80:36)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
at Object.run (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:184:11)
First install the cocoapods
sudo gem install cocoapods
Then run the below command on root folder
cd ios && pod install && cd ../ && react-native run-ios
Step 1:
sudo gem install cocoapods
Step 2:
cd ios && pod install && cd ../ && react-native run-ios
If you still get error while installing pods continue the below steps.
Step 3: Put this in console ->
xcrun -k --sdk iphoneos --show-sdk-path
if the answer is
xcrun:_ error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
then put this:
sudo xcode-select --switch /Applications/Xcode.app
Then install pod again
I had the same issue and I solve the problem using bellow approach.
Navigate to iOS folder and then run bellow command:
pod update
pod update command will update all dependency and generate a "Podfile.lock" file.
I had a similar issue and resolved it by jumping into the ios folder and running:
pod update
Doing this directly in the ios folder resulted in the generation of Podsfile.lock
Changing out of ios into the main directory I was able to then launch the app on an IOS simulator using:
npx react-native run-ios
I have tried many solutions. But finally tried something logical. I don't know why i didn't tried first :)
pod install doesn't work.It changes nothing. The problem is "Podfile" is there but not "Podfile.lock". Thats the problem. When we try install again, it is doing nothing because Podfile is there.
Solution is removing "Podfile" then pod install again. Then you will see both files "Podfile" and "Podfile.lock". After many hours of struggling, this was the solution for me and i have tried many thing :) Good luck to you all.
For anybody with Mac M1 that nothing worked and still having the problem.
They actually say at the docs you need to run those commands
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
when it ends will tell
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Pod installation complete! There are 55 dependencies from the Podfile and 46 total pods installed.
if you go and now run pod install you will notice the deference
This solution would work when you are trying to START a project, I don't know if it would help while you are in one and come across this issue.
Here is what I did:
install node.js (unless you already have it downloaded)
TO CHECK: go into terminal and type: node -v
install homeBrew (unless you already have it downloaded)
To download: go into terminal and type: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
remember to read what it says on the terminal to fully download it (there should be like two other commands you put in)
install watchman, on terminal type: brew install watchman
on terminal uninstall all your cocoapod stuff. Check how to with this link: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
open up VScode
type npx react-native init TestProject
choose the method to install Cocoapods through Homebrew
This worked for me.

Ionic cordova build iOS not creating build folder and getting sass gulp error

I just upgraded my MacOS environment from Ionic CLI 1.7.14 to v5.2.6. This also required me to upgrade NodeJS to v10.16.3. I am having several issues but one of which is when I build the app the platforms/ios/build directory is not being created.
However, I can deploy the app right from Xcode to my test phone - but its all wonky, missing images, backend server api calls not working, in app url links to other in app pages not working. Even after deploying from Xcode though there still is no build directory. As well, Safari web inspector would open a blank window...no elements, console info, nothing.
It doesn't appear that I have any errors in my build. Below is the --verbose output:
/users/macknife/dev/MyApp> ionic cordova build ios --buildFlag='-UserModernBuildSystem=0' --verbose
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'build', 'ios' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, buildFlag: '-UserModernBuildSystem=0', project: null, '--': [] } +5ms
ionic:lib:project Project type from config: Ionic 1 (ionic1) +0ms
ionic:lib:project Project details: { configPath: '/Users/macknife/dev/MyApp/ionic.config.json', errors: [], context: 'app', type: 'ionic1' } +0ms
ionic Context: { binPath: '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic', execPath: '/Users/macknife/dev/MyApp', version: '5.2.6' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/macknife/dev/MyApp/config.xml', package.json: '/Users/macknife/dev/MyApp/package.json') +0ms
ionic:lib:build build options: { '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'ios',
ionic:lib:build project: undefined,
ionic:lib:build verbose: false,
ionic:lib:build type: 'ionic1' } +0ms
ionic:lib:telemetry Sending telemetry for command: 'ionic cordova build' [ 'ios',
ionic:lib:telemetry '--verbose',
ionic:lib:telemetry '--interactive',
ionic:lib:telemetry '--color',
ionic:lib:telemetry '--build-flag=-UserModernBuildSystem=0' ] +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +12ms
> ionic-v1 build
ionic:v1-toolkit:lib:gulp Using gulpfile: /Users/macknife/dev/MyApp/gulpfile.js +0ms
ionic:v1-toolkit:lib:gulp Using gulp: /Users/macknife/dev/MyApp/node_modules/gulp/index.js +2ms
ionic:v1-toolkit:lib:gulp Loaded gulp tasks: { default: { fn: [Function], dep: [ 'sass' ], name: 'default' }, sass: { fn: [Function], dep: [], name: 'sass' }, watch: { fn: [Function], dep: [ 'sass' ], name: 'watch' } } +957ms
[10:25:49] Invoking sass gulp task.
ionic:lib:hooks Looking for ionic:build:after npm script. +3s
> cordova build ios --verbose
No scripts found for hook "before_build".
Executing script found in plugin cordova-custom-config for hook "before_prepare": plugins/cordova-custom-config/hooks/restoreBackups.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Skipping auto-restore of config file backup(s)
Executing script found in plugin cordova-custom-config for hook "before_prepare": plugins/cordova-custom-config/hooks/applyCustomConfig.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Finished applying platform config
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform ios
Checking for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in ios platform
No differences found between plugins added to project and installed in ios platform. Continuing...
Generating platform-specific config.xml from defaults for iOS at /users/macknife/dev/MyApp/platforms/ios/MyApp/config.xml
Merging project's config.xml into platform-specific iOS config.xml
Merging and updating files from [www, platforms/ios/platform_www] to platforms/ios/www
copy www/css/ionic.app.css platforms/ios/www/css/ionic.app.css (updated file)
copy www/css/ionic.app.min.css platforms/ios/www/css/ionic.app.min.css (updated file)
copy www/index.html platforms/ios/www/index.html (updated file)
Current launch storyboard CDVLaunchScreen
Not changing launch storyboard setting in info plist.
Wrote out iOS Bundle Version "0.2.90" to /users/macknife/dev/MyApp/platforms/ios/MyApp/MyApp-Info.plist
No need to update build settings for launch storyboard support.
Set IPHONEOS_DEPLOYMENT_TARGET to "9.3".
Did not update build settings for launch storyboard support.
iOS Product Name has not changed (still "MyApp")
Updating icons at platforms/ios/MyApp/Images.xcassets/AppIcon.appiconset/
Updating splash screens at platforms/ios/MyApp/Images.xcassets/LaunchImage.launchimage/
Updating launch storyboard images at platforms/ios/MyApp/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
Executing script found in hooks directory for hook "after_prepare": hooks/after_prepare/010_add_platform_class.js
Running command: /users/macknife/dev/MyApp/hooks/after_prepare/010_add_platform_class.js /users/macknife/dev/MyApp
add to body class: platform-ios
Command finished with error code 0: /users/macknife/dev/MyApp/hooks/after_prepare/010_add_platform_class.js /users/macknife/dev/MyApp
Executing script found in plugin cordova-custom-config for hook "after_prepare": plugins/cordova-custom-config/hooks/applyCustomConfig.js
cordova-custom-config: Loaded module dependencies
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Finished applying platform config
Executing script found in plugin cordova-plugin-facebook4 for hook "after_prepare": plugins/cordova-plugin-facebook4/scripts/after_prepare.js
Executing script found in plugin cordova-plugin-firebasex for hook "after_prepare": plugins/cordova-plugin-firebasex/scripts/after_prepare.js
Preparing Firebase on iOS
Ionic:
Ionic CLI : 5.2.6 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.0.0
#ionic/v1-toolkit : 1.0.22
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 32 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
ios-deploy : 1.9.4
ios-sim : 8.0.2
NodeJS : v10.16.3 (/usr/local/bin/node)
npm : 6.11.2
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61
======================
On a hunch, I removed the auto-installed Cordova-plugin-ionic-webview (that seems to be standard with Ionic CLI when building a new app) and returned to using a my previous web view-plus (yes, very old, but its what I have been using until this big CLI upgrade - and it was working just fine). I tried building again from console and it did so without any error but again no platform/ios/build folder - however, I could deploy my app cleanly from Xcode - all the wonky stuff was gone - and my app was working AND I could manage the app from Safari web inspector again. Something about ionic-web view must be causing all the wonkiness - but still does not explain the build issue.
This is often the caused by several versions of gulp installed at the same time.
Try deleting both the package-lock.json file and node_modules folder. Then reinstall the dependencies with npm i and try building your app again.
I've encountered a similar situation before. This is the solution which worked for me:
Remove the IOS platform ionic cordova platform remove ios
Add the platform again ionic cordova platform add ios
Use XCode to configure signature settings
Also in XCode under File -> Workspace settings enable the "Legacy build system"
Try your build again
I reinstalled my project and aligned my gulp versions and issue still was happening.
Turns out the Preparing Firebase on iOS was the clue. Its the last message before the build prematurely exits, but exits with no errors, issues, warnings or anything.
Cordova-plugin-firebasex #6.0.7 has an issue that hoses the build. I downgraded to v6.0.6 and everything builds fine now.

Resources