Search code examples
cordovatfsbuildvisual-studio-cordova

iOS build fails, produces wrong project name for Cordova 6.1.0


I'm using vsts-cordova-tasks with on-premises TFS (2015 Update 1). After updating the Cordova CLI option in taco.json to 6.1.0 from 5.4.1, my builds are failing with errors like:

Cordova version set to 6.1.0 based on the contents of taco.json
Module cache at /Users/rob/.taco_home/node_modules
[email protected] 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'

In the build agent source folder, under platforms/ios, instead of the expected myapp folder, there's a HelloCordova folder.

If I run cordova remove platform ios, cordova platform add ios, cordova build from terminal the expected folder under platforms/ios is generated and the build works as expected.

Edit: Using the Cordova CLI the correct folder is generated at first, but is then renamed to HelloCordova.

I guess the build task is not finding config.xml, which contains the correct app name, and it's falling back to HelloCordova? I've tried setting the working directory in the build definition and it appears to be correct. I can get the build to work again just by changing the target Cordova version in taco.json.

Build steps screenshot: enter image description here


Solution

  • Can you go to platforms/ios/HelloCordova/config.xml, and check if you have HelloCordova inside. (try it out locally or on your build server)

    looking at platformis/ios folder the name of the folder is correctly set at first, but after it's changed to 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".
    

    I know, that's not a real answer, so it can be deleted afterwards, but hopefully would shed some light as of now.

    *Doesn't happen when creating a new project though.

    Workaround: Works nicely by downgrading to 6.0.0