我正在使用内部TFS(2015 Update 1)的vsts-cordova-tasks。将taco.json中的Cordova CLI选项从5.4.1更新到6.1.0之后,我的构建失败,出现以下错误:
Cordova version set to 6.1.0 based on the contents of taco.json
Module cache at /Users/rob/.taco_home/node_modules
cordova@6.1.0 already installed.
Adding support plugin.
Processing res/native for ios
Queueing build for platform ios w/options: none
Processing res/native for ios
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/rob/agent/_work/5/s/myapp/platforms/ios/myapp/config.xml
ENOENT: no such file or directory, open '/Users/rob/agent/_work/5/s/myapp/platforms/ios/myapp/config.xml'
在构建代理程序源文件夹中,在platforms / ios下,而不是预期的myapp
文件夹,有一个HelloCordova
文件夹。
如果我从终端运行。 cordova remove platform ios
,cordova platform add ios
,cordova build
,则会生成平台/ ios下的预期文件夹,并且构建按预期工作
编辑:首先使用Cordova CLI生成正确的文件夹,然后将其重命名为HelloCordova。
我猜构建任务没有找到config.xml,它包含正确的应用程序名称,而且它正在回归到HelloCordova?我已经尝试在构建定义中设置工作目录,它看起来是正确的。我可以通过更改taco.json中的目标Cordova版本来重新构建构建。
答案 0 :(得分:1)
你可以去platform / ios / HelloCordova / config.xml,检查你里面是否有HelloCordova。 (在本地或在构建服务器上试用)
查看platformis / ios文件夹,首先正确设置文件夹的名称,但在将其更改为HelloCordova之后。
Install complete for cordova-plugin-whitelist on ios.
1> Executing "after_plugin_install" hook for "cordova-plugin-whitelist" on ios.
1> Executing "before_prepare" hook for all plugins.
1> Executing "before_build" hook for all plugins.
1> Searching PlatformJson files for differences between project vs. platform installed plugins
1> No differences found between project and ios platform. Continuing...
1> Generating config.xml from defaults for platform "ios"
1> Wrote out iOS Bundle Identifier to "com.cct.driverapp"
1> Wrote out iOS Bundle Version to "1.0.0"
1> Set IPHONEOS_DEPLOYMENT_TARGET to "9".
1> Wrote out iOS Product Name and updated XCode project file names from "SomeAppName" to "HelloCordova".
我知道,这不是一个真正的答案,因此可以在之后删除,但希望现在可以解决一些问题。
*虽然在创建新项目时没有发生。
解决方法:通过降级到6.0.0
很好地工作