ERROR building one of the platforms: IOS - ios

Following ionic lessons about up and running mobile hybrid app I was stumbled at step:
$ ionic build ios
the following error is:
$ ionic build ios
Running command: "c:\Program Files (x86)\nodejs\node.exe##c:\wamp\www\weather\hooks\after_prepare\010_add_platform_ class.js c:/wamp/www/weather
add to body class: platform-ios
Running command: cmd "/s/c"c:\wamp\www\weather\platforms\ios\cordova\build""
'c:\wamp\www\weather\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
at ChildProcess.whenDone (c:\Users\Acer\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
I have no troubles with ionic build android.
Could You help me with some suggestions where the problem come from?
Tnx in advance!

I see you use Windows.
Note: iOS development requires Mac OS X.
Source: http://ionicframework.com/getting-started/
If you really need to build for iOS, you will need to buy a Mac (yeah, this is really sad) or use a solution that handles this kind of case, like Phonegap.
If I remember well, the Ionic team is working on a solution solving this, but it is not yet ready.

Related

Kotlin Multiplatform Mobile unable to run on iOS: Execution failed for task ':shared:compileKotlinIosX64'

I have created fresh project(Hello World) in KMM followed by their official website. In android it works smooth but when I am trying to run in XCode it's giving errors because of which I am unable to build / run the xcode project. I have attached screenshots and logs for my errors. Somehow xcode scheme is not getting generated in the KMM platform that's what I am guessing.
Can anyone please help me understand what am I missing?
Any help would be appriciated.
Following is my dev env:
Xcode 11.4.1
Android 4.1.2
Kotling Plugin version 1.4.30 (stable)
KMM 0.2.0```
XCode Logs:
> Task :shared:compileKotlinIosX64
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Extracting dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz into /Users/fatin/.konan/dependencies
e: java.lang.RuntimeException: Cannot extract archive with dependency: /Users/fatin/.konan/cache/clang-llvm-apple-8.0.0-darwin-macos.tar.gz.
> Task :shared:compileKotlinIosX64 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:compileKotlinIosX64'.
> Compilation finished with errors
* 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 7s
1 actionable task: 1 executed
Command PhaseScriptExecution failed with a nonzero exit code ```
[![enter image description here][3]][3]
I reached out to community for this and finally found the solution. Here is the link to that issue which I raised and solved this problem.
If anyone else is going through this same issue it mostly cause of corrupted kotlin file.
Also try checking your cmd line tools in XCode as per comments.
Hope this helps someone. Cheers.
If the project doesn't run right away even on opening it from Xcode and shows the shared framework is missing, Then try generating the shared framework for iOS platform using terminal. Navigate to the project folder and execute
Command: ./gradlew packForXcode Now the shared framework should have a xcode-frameworks product and you should be able to build and run the project through Xcode.
This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.

ionic fails to add iOS platform

when I try the following command in VS Code
sudo ionic cordova platform add iOS
I get an error with the following:
ERROR] An error occurred while running subprocess cordova.
cordova platform add ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I get iOS folder in platforms folder, but how to solve this error ?
First, why are you running with sudo? I would recreate the project in a directory which does not require this. For example ~/dev/myProjectName
Second, when you scroll up it should give a more specific error.
Third, if not have you tried doing as shown and run with --verbose flag?
Fourth, try opening platform/ios project in xCode and running from there. It may give more useful info.

meteor ios cordova ENOET, no such file or director

Hey I started an app with yeomans angular-meteor generator.
Installed Xcode and followed steps to add ios sdk and plataform to my meteor project.
I have tried removing/adding ios platform.
I have tried changing ownership of my meteor project.
But still no luck. Here is the output of the error:
=> App running at: http://localhost:3000/
=> Errors executing Cordova commands:
While running Cordova app for platform iOS with options --emulator:
Error: Command failed:
/Users/donedgardo/marAzul/.meteor/local/cordova- build/platforms/ios/cordova/run --emulator
ENOENT, no such file or directory
'/Users/donedgardo/Library/Logs/CoreSimulator/6EB83B1C-FA07-4728-BE3A-CBA81E4707D1/system.log'
Error code 1 for command: ios-sim with args:
launch,/Users/donedgardo/marAzul/.meteor/local/cordova- build/platforms/ios/build/emulator/marAzul.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/donedgardo/marAzul/.meteor/local/cordova-build/platforms/ios/cordova/console.log,--stdout,/Users/donedgardo/marAzul/.meteor/local/cordova-build/platforms/ios/cordova/console.log,--exit
at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
ExitWithCode:1
You should chek your mobile-config.js file content. Most or errors are linked to this : maybe your icons or splascreen are not accessible or are in a wrong format (prefer png).
Clean your mobile-config (or use the standard one from meteorJs) and test it.

Apache Cordova - cordova platform add iOS failed

I seriously need help in this area. This is my first time working with the iOS platform for apache cordova. I have already downloaded the latest Node.js tool and Apache Cordova on my macbook. The PATH is also set up already. I was following the Apache Cordova command line steps, and when I tried to run the following command:
cordova platform add ios
I received the following error message:
/Users/metanoiasherman/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/create: line 80: dirname: command not found
cat: /Users/metanoiasherman/DropPositioning/../CordovaLib/VERSION: No such file or directory
Error: /Users/metanoiasherman/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
This is what my $PATH prints out in Terminal:
/Users/metanoiasherman/./usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/lib/node_modules/cordova/bin/
Can anyone tell me what I need to do?
I have just downloaded the Xcode command line tools and installed it already. Do I have to restart my macbook? Can someone present me with the steps I need to take to solve this and progress on?
It might be an issue with your $PATH
Try to run
$PATH
from the terminal and check if that includes the same path stated when you run:
which cordova

Cordova platform add ios - Error Command failed with exit code 2

I am trying to add the iOS platform to my cordova project but I keep coming across the same error. I have followed the instructions here.
When I use cordova platform add ios it gives me the following error
Shauns-MacBook-Pro:hello shaunbrown$ cordova platform add ios
Creating ios project...
Unknown option: n
Usage: head [-options] <url>...
Cordova can only run in Xcode version 4.6 or greater.
Error: /Users/shaunbrown/.cordova/lib/ios/cordova/3.5.0/bin/create: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)
I have tried looking around for the error but I can't find anything.
I am running xCode 5.1.1 so I know it doesn't have anything to do with that. Has anyone else came across this issue, or has a fix for this? I am pulling my hair out trying to fix it and so far I havent got anywhere.
I can provide more information if needed.
I managed to solve this. I opened my .bash_profile file and commented out the line that referred to my XAMPP installation.
I then restarted terminal and it worked perfectly.
You might have Xcode 5.x, but your command line tools are probably set up for a previous version.
Type:
xcodebuild -version
In a terminal. If you need to update, read this:
Xcode 4.4 and later install Command Line Tools

Resources