无法在Cordova 5.0.0中添加或构建ios平台

时间:2015-04-28 18:06:40

标签: ios cordova npm platform

当我将ios平台添加到样板库Cordova项目时,我遇到了这个问题:

jondamato$ cordova platform add ios

Adding ios project...
mv: no such file or directory: project.pbxproj

mv: dest is not a directory (too many sources)

mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/__PROJECT_NAME__-Info.plist

mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/__PROJECT_NAME__-Prefix.pch

mv: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/gitignore

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld.xcodeproj/project.pbxproj

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/AppDelegate.h

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/AppDelegate.m

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/MainViewController.h

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/Classes/MainViewController.m

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/main.m

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Info.plist

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Prefix.pch

sed: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/hiworld-Info.plist

rm: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/CordovaLib

cp: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld/.gitignore

grep: no such file or directory: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/hiworld.xcodeproj/project.pbxproj


/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:266
    throw new Error('Subproject: ' + subprojectPath + ' entry not found in
          ^
Error: Subproject: CordovaLib/CordovaLib.xcodeproj entry not found in project file
at update_cordova_subproject (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:266:15)
at copyJsAndCordovaLib (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:69:9)
at Object.exports.createProject (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/lib/create.js:202:5)
at Object.<anonymous> (/Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/create:53:12)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
Error: /Users/jondamato/.cordova/lib/npm_cache/cordova-ios/3.8.0/package/bin/create: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

看起来像Cordova创建项目文件但无法加载它们。当我尝试构建项目时,这就是我得到的:

jondamato$ cordova build ios
cp: no such file or directory: *new/hiworld/config.xml

mkdir: path already exists: /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/www

cp: no such file or directory: *new/hiworld/www/css

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html
cp: no such file or directory: *new/hiworld/www/js

cp: no such file or directory: *new/hiworld/www/css
cp: no such file or directory: *new/hiworld/www/css/index.css
cp: no such file or directory: *new/hiworld/www/img
cp: no such file or directory: *new/hiworld/www/img/logo.png
cp: no such file or directory: *new/hiworld/www/index.html
cp: no such file or directory: *new/hiworld/www/js
cp: no such file or directory: *new/hiworld/www/js/index.js

Parsing /Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/__CLI__/config.xml failed
Error: ENOENT, no such file or directory '/Users/jondamato/cli/cordova/*new/hiworld/platforms/ios/__CLI__/config.xml'
    at Object.fs.openSync (fs.js:439:18)
    at Object.fs.readFileSync (fs.js:290:15)
    at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:118:27)
    at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/configparser/ConfigParser.js:33:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:115:32
    at Array.map (native)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:70:40
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)

初步构建文件最终会出现在我的目录中。 谁能告诉我发生了什么事?我已经卸载并重新安装了Cordova几次,希望它会有所帮助,但没有运气。

谢谢!

1 个答案:

答案 0 :(得分:0)

我发现我的目录名中的星号让科尔多瓦以某种方式吓坏了。只需确保您的Cordova项目不在名称中带星号的文件夹中。