1
votes

I have a Cordova app that I've been developing using Visual Studio Tools for Apache Cordova.

The app is to run on iOS and Android (at least)

I am using Visual Studio Team Services for my source control and to also build the app. Additionally, I've hooked VSTS to HockeyApp, with the intention of having a workflow that will allow me to build and then distribute the app to my testers.

The Android build is working fine.

The iOS build is doing my head in.

I think my issue lies with the Signing Certificate and/or the Provisioning Profile.

I have created the signing certificate via my Apple Developer Account. I then download the cert and imported it into Key Chain Access. I then exported the cert as a .p12 file and included it with the application source.

I have also created a provisioning profile, and included the UUIDs of my test iOS devices. This is linked to the above cert, and has also been included with the application source.

In VSTS, I configured the Cordova Extension to allow me to build.

I've configured the "Cordova Build" step to include the cert and provisioning profile:

enter image description here

However, no matter what I do, my builds are failing with the following error message:

2016-05-07T13:00:49.400Z: Cordova version set to 6.0.0 based on the contents of taco.json
2016-05-07T13:00:49.405Z: [command]/usr/local/bin/node /Users/brendan/agent/_work/tasks/CordovaBuild/1.3.8/cordova-task.js
2016-05-07T13:00:49.946Z: [command]/bin/bash /Users/brendan/agent/_work/tasks/CordovaBuild/1.3.8/lib/createkeychain.sh /Users/brendan/agent/_work/2/s/paygle.cordova/_tasktmp.keychain 0.3689059684984386 /Users/brendan/agent/_work/2/s/paygle.cordova/deploy/certificate.p12 ********
2016-05-07T13:00:50.085Z: 1 identity imported.
2016-05-07T13:00:50.156Z:      0 valid identities found
2016-05-07T13:00:50.164Z:     "/Library/Keychains/System.keychain"
2016-05-07T13:00:50.240Z: Command failed: /usr/bin/security find-identity -v -p codesigning "/Users/brendan/agent/_work/2/s/paygle.cordova/_tasktmp.keychain" | grep -oE '"(.+?)"'
2016-05-07T13:00:50.241Z: 

I've checked and rechecked the documentation on this, but it's not really clear to me what the issue is. I suspect that the cert and/or provisioning profile hasn't been created properly, but I'm not sure which bit is wrong.

Any help appreciated.

1

1 Answers

0
votes

There are another two points you need to know that may cause the signing issue when your build on MAC according to the instruction on MSDN:

  1. Apple's WWDR certificate

Notice: Apple's WWDR certificate expired on Feb 14th and as a result you may experience signing failures if you have not updated the cert and removed the old one. Follow the steps outlined by Apple under What should I do if Xcode doesn’t recognize my distribution certificate? to resolve the problem. Note that this also affects development certs despite the title.

However, this issue affects the Xcode, but you are using Cordova. So you can check Point 2 first.

  1. Build Agent

Troubleshooting Tip: You should either setup the cross-platform agent as a launch agent (./svc.sh install agent) or run it as an interactive process (node agent/vsoagent.js) when building an Cordova project targeting iOS due to issues with code signing certificate storage when using a launch daemon.

More detailed information about App Signing: Simple, Secure CI App Signing Using Visual Studio Team Services or Team Foundation Server 2015