Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building ios with cordova

Tags:

ios

cordova

I have a problem when I build the ios platform with cordova. I have all the certificates for the app and device, but when I try to run in my ios device, doing ionic run ios, the console return this error:

Error: Source path does not exist: resources/ios/icon/[email protected] 

This path is written in config.xml file.

I tried to run it in xCode but the problem there was:

Cordova/CDVViewController.h not found 

I read a lot of possible solutions but any works for me.

My xCode version is 7.3.1, the cordova version is 6.3.0 and the cordova ios version is 4.2.0.

like image 494
Ary Avatar asked Jul 27 '16 14:07

Ary


People also ask

Does Cordova work for iOS?

You can use cordova run ios --list to see all available targets and cordova run ios --target=target_name to run application on a specific device or emulator (for example, cordova run ios --target="iPhone-6" ). You can also use cordova run --help to see additional build and run options.

What is the latest Cordova iOS version?

Cordova iOS 6.2. 0 Released! We are happy to announce that we have just released Cordova iOS 6.2. 0 !

Do you need Xcode for Cordova?

iOS Device You can test many of the Cordova features using the iOS simulator that is installed with the iOS SDK and Xcode, but you will need an actual device to fully test all of the device features used in your applications before submitting to the App Store. The device must have at least iOS 5.


2 Answers

If you are missing the icon you can run the command

ionic resources --icon 

This will generate all the icons with the pixels needed to run on any device.

To simulate on the device you first need to

ionic build ios 

and then

ionic simulate ios 

It is also a good practice to have xcode up to date.

If you are still getting the error you can paste this line

"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" 

on Build Settings > Header Search Paths. Do not remove the similar line, just add it at the end.

like image 181
Joseph Ocasio Avatar answered Oct 23 '22 20:10

Joseph Ocasio


Update - 03-08-2017

> ionic cordova resources 

Old CLI command:

I had the same error, and after re-running ionic resources it went away.

The problem was that I had Windows-style slashes (backslashes) in the path of the icon, i.e. the error I had was this:

Error: Source path does not exist: resources\ios\icon\icon-40.png

So, converting backslashes into slashes resolved it for me.

Update: And regarding your second error, it helped me to reset the state:

ionic state reset

Make sure you have ios listed under cordovaPlatforms in your package.json before running this command. Then ionic automatically re-downloads your plugins afresh and is ready to build.

Hope that helps. Take care!

like image 21
Eric Gopak Avatar answered Oct 23 '22 20:10

Eric Gopak