Build failing for 'ionic build ios' on OSX 10.12.1 - ios

So this is a brand new Mac Air.. running Sierra.
When i run
ionic build ios
i get
** BUILD FAILED **
The following build commands failed:
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/AppDelegate.o homepocket/Classes/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/foo/Library/Developer/Xcode/DerivedData/homepocket-gtpsstxtfgknjdgahozlqhgfgmmi/Build/Intermediates/homepocket.build/Debug-iphonesimulator/homepocket.build/Objects-normal/x86_64/MainViewController.o homepocket/Classes/MainViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/cordova/build-debug.xcconfig,-workspace,myproject.xcworkspace,-scheme,myproject,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/foo/workspace/myproject_mobile/myproject/platforms/ios/build/sharedpch
I installed latest xcode via apple store.
I set the machine to dev mode via xcode ide.
I've ran the emulate through xcode.
I can successfully 'ionic build android' as well as emulate.
I've also run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Because i was seeing
Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
.. mind you all of this is a fresh box from Apple.

After finding this.. https://forum.ionicframework.com/t/cordova-cdvviewcontroller-h-file-not-found-in-xcode-7-1-beta/32232/47
The solution for me was ...
ionic platform remove ios
ionic platform add ios#3.9.2
ionic prepare ios
Then i could build ios.

Related

react-native build failing due to PhaseScriptExecution error

Environment
Mac OS X Version 12.1 (Apple M1 chip)
Xcode Version 13.2.1
Simulator Version 13.2 (972.2)
react-native-cli 7.0.3
node v18.4.0
The Issue
This is my first time working on developing an app using React Native. I am trying to run my React Native project on Xcode's simulator, using npx react-native run-ios. However, I am encountering this error message.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening MCompass.xcworkspace.
Command line invocation:
/Users/brx/Downloads/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MCompass.xcworkspace -configuration Debug -scheme MCompass -destination id=DC3C75E6-19FD-4B80-87B1-62BF6404ED20
...
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/brx/src/projects/test/MCompass/ios/build/MCompass.build/Debug-iphonesimulator/MCompass.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'MCompass' from project 'MCompass')
(1 failure)
Between the first error message and ** BUILD FAILED **, there were many lines of output listing exports.
I've installed dependencies using both yarn and npm. I've also looked at several other threads with this same issue, but none of the solutions (such as having only one version of nvm or running react-native upgrade) have been successful. Does anyone have any tips?
I had my root folder name "REACT NATIVE", changing it to "REACT_NATIVE" fixed the error as the folder that contains your react native project cannot contain white spaces.
The second solution would be running Xcode with rosetta. This is only applicable for M1 chip macbooks as there are few times Xcode projects fail because of this reason. Please refer to below link for reference:
https://penny-huang.medium.com/xcode-how-to-run-ios-simulator-on-m1-mac-66101b9fccd8

React-native iOS app not running on terminal and Xcode also

Hello I'm Beginner in React Native,
I've installed everything did they said.
Now I've created application using below command
react-native init TempApp
Application is created successfully
Now I try to run application using below command
npx react-native run-ios
I got below error
** BUILD FAILED **
The following build commands failed:
CompileSwift normal x86_64 /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift
CompileC /Users/encora/Library/Developer/Xcode/DerivedData/TempApp-fnxepatpnxxjncbfdflpymtfxxag/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o /Users/encora/Documents/Paresh\ Workspace/React\ Native\ Projects/TempApp/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
Even I try to run application from Xcode also, but I still get error in Xcode also.
Can anyone help me please how to run first react application on Mac
Try this -
Close the Xcode,delete node_modules folder and then run commands in project directory
npm install / yarn install
cd ios && pod install --repo-update
npx react-native run-ios
Option 3 is optional either run project from terminal or from Xcode

Build of reactNative app fails on IOS using CLI and xcode

I tried to build a simple reactNative app for ios using CLI and xcode.
Both builds fails with a different error.
Prior to both builds, I ran the following
npm install
pod install
Build using CLI
The steps are:
npx react-native run-ios
Having done so I found some errors on the log file which I am attaching
manish.basdeo#AMAC02SNHPHFVH3 Top100 % npx react-native run-ios
info Found Xcode workspace "Top100.xcworkspace"
info Launching iPhone 11 (iOS 13.3)
info Building (using "xcodebuild -workspace Top100.xcworkspace -configuration Debug -scheme Top100 -destination id=37E2E23C-60E2-42D4-8053-525A907ED979")
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening Top100.xcworkspace. Run CLI with --verbose flag for more details.
Build settings from command line:
TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault
Prepare build
note: Using legacy build system
<unknown>:0: error: no such file or directory: '/Users/manish.basdeo/Desktop/Top100/Top100/ios/Pods/#/Users/manish.basdeo/Library/Developer/Xcode/DerivedData/Top100-etyxtwwnmplrdtdxgkmuhxstoudh/Build/Intermediates.noindex/Top100.build/Debug-iphonesimulator/Top100.build/Objects-normal/x86_64/Top100.SwiftFileList'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
** BUILD FAILED **
The following build commands failed:
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(1 failure)
2) Build using XCODE
How can I fix both errors?

Xcode build errors when running Cordova run command

I am using the latest version of Cordova 6.4.0 to build an application on the iPhone (using Xcode obviously).
When I run the cordova run command to build the app I get the following errors in the terminal.
<unknown>:0: error: failed to import bridging header
'/Users/development/abc/mobapp/platforms/ios/abchq/Bridging-Header.h
** ARCHIVE FAILED **
The following build commands failed:
CompileSwiftSources normal arm64 com.apple.xcode.tools.xwift.compiler
CompileSwift normal arm64 /Users/development/abc/mobapp/platforms/ios/QuickPost/NetworkTableViewController.swift
CompileSwift normal arm64 /Users/development/abc/mobapp/platforms/ios/QuickPost/ShareViewController.swift
(3 failures)
Error: Error code 65 for command: xcodebuild with args:- xcconfig...... (a lot more info)
Can anyone suggest what could the cause of all of this - when I run this on the same machine for the Android it runs fine?? Any ideas?
My machine information is as follows:
Cordova CLI : 6.4.0
ios-deploy version : 1.9.1
ios-sim version: 5.0.13
OS : macOS Sierra
Node version : v7.1.0
Xcode version : Xcode 8.2.1 Build version 8C1002
The "Objective-C Bridging Header" setting (aka SWIFT_OBJC_BRIDGING_HEADER) must be set at the Target level, and NOT the Project level. Be sure to delete the setting value at the Project level. This should resolve the issue.
Check out this SO post for more info on this.

Error building app for ios in phonegap (for android is working fine)

I am developing an app with phonegap and I have always been testing the app using the android simulator and I have not had any problems, but I can not get it to work for iOS.
I'm working on a Mac OS mavericks and have installed Xcode.
When I run the command "phonegap run ios", I get the following:
[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] compiling iOS...
Build settings from command line:
ARCHS = i386
CONFIGURATION_BUILD_DIR = /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/build/emulator
SDKROOT = iphonesimulator7.1
VALID_ARCHS = i386
xcodebuild: error: The project ‘NombreApp.xcodeproj’ does not contain a target named ‘NombreApp’.
[error] /Users/usuario/Desktop/desarrolloapp/nombreapp/platforms/ios/cordova/build: Command failed with exit code 65
Any idea about what's going on?
EDIT: I solve this doing:
Remove ios folder from platforms.
Run again (phonegap run ios).
Install ios-sim with command sudo npm install -g ios-sim.
All worked fine!
A lot of thanks.
Best regards.
Manually create target with name NombreApp in Xcode as given this link :
->
How to create or define a new target in a custom Xcode project template
Regards,

Resources