cordova create hello com.example.hello HelloWorld
The project was created successfully, and then I added the ios platform
cordova platform add ios
and verified that I added it correctly, I Enter
cordova platform list
The iOS platform is displayed in the list. So at this point, according to the PhoneGap tutorial, I can use the command
cordova build ios
Build the iOS version of the project. However, I encountered the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.(/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js: 98:17)
at maybeClose (child_process.js:735:16 )
at Socket.(child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net. js:466:12)
The results of my google search are mainly about the android version, talking about invalid environment path settings. I don’t know if it is relevant, because I can create and build an Android platform There is no problem with the PhoneGap project.
This is my $PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/ usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm:/Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/ tools
Edit:
Reinstalling xcode from the app store solved this problem
cordova platform rm android
cordova platform add android< br />cordova build android
In the Node.Js console. Try it in ios.
If you make a mistake in’cordova platform add android’, you may need to delete it manually Any android folder in the project folder hierarchy.
I used the following command to create a new hello world project,
cordova create hello com.example.hello HelloWorld
The project was created successfully, and then I added the ios platform
co rdova platform add ios
and verify that I have added it correctly, I enter
cordova platform list
The iOS platform is displayed in the list So at this point, according to the PhoneGap tutorial, I can use the command
cordova build ios
to build the iOS version of the project. However, I encountered To the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command " /Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.(/usr/local/lib/node_modules/cordova/src/compile.js: 65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.(child_process .js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
The result of my google search is mainly about the android version , Talking about invalid environment path settings. I don’t know if it is relevant, because I can create and build a PhoneGap project for the Android platform without problems.
This is my $PATH:
< p>
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm: /Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/tools
Edit:
Reinstalling xcode from the app store solved this problem< /p>
I encountered the same problem on the Android platform, and it was solved by the following command:
cordova platform rm android
cordova platform add android
cordova build android
In the Node.Js console. Try it in ios.
If you are There is an error in’cordova platform add android’, you may need to manually delete any android folder in the project folder hierarchy.