ionic build ios error unrecognized command - ios

Just testing a app. Trying to run the ios simulator. Got error message. Please help.
$ ionic build ios Running command: "C:\Program Files\nodejs\node.exe"
C:\Users\Johnson\desktop\ionic\todo\hooks\after_prepare\010_add_platform_class.js
C:/Users/Johnson/desktop/ionic/todo add to body class: platform-ios
Running command: cmd "/s /c
"C:\Users\Johnson\desktop\ionic\todo\platforms\ios\cordova\build""
'C:\Users\Johnson\desktop\ionic\todo\platforms\ios\cordova\build' is
not recognized as an internal or external command, operable program or
batch file. ERROR building one of the platforms: Error: cmd: Command
failed with exit code 1 You may not have the required environment or
OS to build this project Error: cmd: Command failed with exit code 1

As the error says
You may not have the required environment or OS to build this project
this refers to you not having iOS build tools (xcode) available on your machine. xcode is not available on windows machines.
You cannot build iOS apps on Windows machines. You may build for android, providing you have the android sdk + build tools installed.

Related

Android Studio KMM Application project - Build for ios platform failing

I am a first timer on KMM and have just created a new KMM application project on Macbook M1 Pro. No code changes, this is just the hello world app that I am using. I have been able to successfully build the project for android platform, and it runs fine on the android emulator. However, when I try to build it for the ios platform, it is failing with the below error message:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':shared'.
> The project must have a target for at least one of the following platforms: ios_simulator_arm64.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 553ms
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Build\ shared /Users/manajit/Projects/Learning/App/KMMExperiment/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-4552119A071AC6BAB7327E6434237EC3.sh (in target 'shared' from project 'Pods')
(1 failure)
Command PhaseScriptExecution failed with a nonzero exit code.
Currently, the base application created by the KMM plugin has commented out support for the ARM simulator because there are some libraries that do not yet support it. This is most likely due to Ktor, which only recently added its support.
Go to shared/build.gradle.kts and uncomment all lines containing iosSimulatorArm64.

Ionic run fail to deploy to device

I am using Mac OS X 10.11. I am trying to deploy build to device (iPhone 4) by running sudo ionic run ios --device and I get this error message:
Check dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/john/Desktop/Myproject/platforms/ios/cordova/build-debug.xcconfig,-project,Myproject.xcodeproj,ARCHS=armv7 armv7s arm64,-target,Myproject,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/john/Desktop/Myproject/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/john/Desktop/Myproject/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
I have no problem when running just only ionic run ios, which will deploy the app into emulator. How can I overcome the problem?
Another method will be
Go to your platform directory of your project /platforms/ios
Write in the console open . which will open your folder with Finder.
After that open YourProject.xcodeproj with XCode and select your device and click on run.
Good luck

iOS remote build fails in Visual Studio TACO

I develop cordova app with Visual Studio 2015 in Windows7.
Node version on Mac is v5.1.0.
While running remotebuild on Mac, start building from Visual Studio.
In emulator mode, it seems to build correctly (msk.test.build.app is created in 'platforms/ios/build/emulator'.)
In device mode, build fails with error below.
I found 'platforms/ios/build/device' is not created, but don't know how to fix.
Submitting new build request to: https://Macintosh.local:3000/cordova/build/tasks?command=build&vcordova=5.4.0&cfg=debug&options=--device&buildNumber=1403&loglevel=warn
------ new build: {"command":"build","vcordova":"5.4.0","cfg":"debug","options":"--device","buildNumber":"1403","loglevel":"warn","status":"Uploaded","buildCommand":"build","buildPlatform":"ios","configuration":"debug","buildLang":"ja-JP","buildDir":"/Users/User/.taco_home/remote-builds/taco-remote/builds/1403","logLevel":0,"submissionTime":"2015-11-18T21:38:43.650Z","changeList":null,"buildSuccessful":false,"messageArgs":null,"message":"Uploaded build request payload.","tgzFilePath":"/Users/User/.taco_home/remote-builds/taco-remote/builds/1403/upload_1403.tgz","appDir":"/Users/User/.taco_home/remote-builds/taco-remote/builds/1403/cordovaApp","statusTime":"2015-11-18T21:38:43.652Z"}
error - Build failed with error Command failed: /bin/sh -c xcrun -v -sdk iphoneos PackageApplication platforms/ios/build/device/msk.test.build.app -o /Users/User/.taco_home/remote-builds/taco-remote/builds/1403/cordovaApp/platforms/ios/build/device/BuildTest2.ipa
xcrun: note: PATH = '/Users/User/.taco_home/node_modules/taco-remote-lib/1.2.0/node_modules/taco-remote-lib/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:”/Applications/Adobe'
xcrun: note: SDKROOT = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk'
xcrun: note: TOOLCHAINS = ''
xcrun: note: DEVELOPER_DIR = '/Applications/Xcode.app/Contents/Developer'
xcrun: note: XCODE_DEVELOPER_USR_PATH = ''
xcrun: note: xcrun_db = '/var/folders/_4/x16l03kx0mxbgd6w_5zp0y5w0000gn/T/xcrun_db'
xcrun: note: xcrun via PackageApplication (xcrun)
xcrun: note: database key is: PackageApplication|/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk||/Applications/Xcode.app/Contents/Developer|
xcrun: note: lookup resolved in '/var/folders/_4/x16l03kx0mxbgd6w_5zp0y5w0000gn/T/xcrun_db' : '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication'
MDAVSCLI : error : Specified application doesn't exist or isn't a bundle directory : 'platforms/ios/build/device/msk.test.build.app'
-------------------------------------
I tried node#0.12.7 on Mac, it works better thanks!
Building works fine and .ipa is created both on Windows/Mac, but stops installing app to my iphone connected by USB to Windows.
Visual Studio output console shows below( the words may be different because mine is Japanese).
:
:
1> ------ copying to project: iOS
2>------ start configuration: project: MSK App, composition:Debug iOS ------
There is a compatibility issue between your version of Node and Cordova 5.4. We are working on fixes both to remote build and Visual Studio to address some of these, but in the meantime I suggest you downgrade to Cordova 5.3 and also take an earlier version of Node (4.2.2 should be OK). That should fix the issue.
(Disclosure: I work on the Tools for Apache Cordova in Visual Studio at Microsoft)
There are known issues with Node version > 4 and Cordova <= 5.3.3 that have been documented here. Also we are seeing issues with Cordova 5.4 and are recommending to downgrade as Michael suggests.
Look Specifically at -
Build not executing when using Cordova with Node.js 5.0.0+ and Cordova 5.3.3 and below
Build hangs or does not execute when building for iOS with Cordova < 5.3.3 and Node.js 4.0.0+
Subhag Oak
(Microsoft)

iOS Build successed by Emulator, but failed by Remote Device

I try to build iOS App from my Win10 in Parallels Desktop. Building Emulator is OK, but I want a .ipa file and try "Remote Device", and has following Error.
Severity Code Description Project File Line
Error Specified application doesn't exist or isn't a bundle directory : 'platforms/ios/build/device/io.cordova.myapp474c62.app' HuaheWeb C:\Projectes\HuaheWeb\HuaheWeb\MDAVSCLI 1
Error Specified application doesn't exist or isn't a bundle directory : 'platforms/ios/build/device/io.cordova.myapp474c62.app' HuaheWeb C:\Projectes\HuaheWeb\HuaheWeb\MDAVSCLI 1
Error Specified application doesn't exist or isn't a bundle directory : 'platforms/ios/build/device/io.cordova.myapp474c62.app' HuaheWeb C:\Projectes\HuaheWeb\HuaheWeb\MDAVSCLI 1
Error Remote build error from the build server Build failed with error Command failed: /bin/sh -c xcrun -v -sdk iphoneos PackageApplication platforms/ios/build/device/io.cordova.myapp474c62.app -o /Users/mai/.taco_home/remote-builds/taco-remote/builds/844/cordovaApp/platforms/ios/build/device/xxx.ipa HuaheWeb C:\Projectes\HuaheWeb\HuaheWeb\MDAVSCLI 1
Error Specified application doesn't exist or isn't a bundle directory : 'platforms/ios/build/device/io.cordova.myapp474c62.app' HuaheWeb C:\Projectes\HuaheWeb\HuaheWeb\MDAVSCLI 1
I had the same problem when building a Cordova app for iOS using Visual Studio 2015 Update 1. In my case it was a problem with the Cordova CLI version - I used "5.4.0" which gave the same errors as you have.
Then I switched back to "5.3.3" (the default version of a new Cordova project in VS) and now it successfully builds the .ipa file.

Development Platform using PhoneGap on a Mac Pro

I am setting up a development platform using my Mac Pro. I have installed GIT, NODEJS, PhoneGap and Cordova. I have cloned a repository to my computer successfully and added the IOS platform. But when I go to build my project I get an error:
Command failed with exit code 2.
Is there something else I need to install?
here is my error:
bash-3.2# sudo -s
bash-3.2# phonegap build ios
[phonegap] executing
'cordova build ios'... Running command:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build
xcode-select: error: tool 'xcodebuild' requires Xcode, but active
developer directory '/Library/Developer/CommandLineTools' is a command
line tools instance
ERROR building one of the platforms: Error:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build:
Command failed with exit code 2 You may not have the required
environment or OS to build this project
Error:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build:
Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
First off all, you don't need Cordova and PhoneGap because you just install the same thing with another name.
After you choosed the name which sounds better for you, you should solve your XCode Problem. There is already a question here on Stackoverflow -> Unable to use xcode-commandlinetools.
As i can see it over there, i first would recommend you to check whether you have installed the latest version of xcode and node. If you already have the latest version, try to re-install Xcode or try to run
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
After you did all like i said try to create a project again.

Resources