0

Building Cordova app via Visual Studio using Remote build. Was using Cordova version 5.3.1, tried updating to the latest version of Cordova too - 6.2.1-nightly.2016.5.23.6e87c71a.

Both times it works in Debug mode but does not work in Release Mode:

Errors - misleading and say nothing whatsoever: https://i.stack.imgur.com/OmP4V.jpg

Part of the Output: ERROR building one of the platforms : error : /Users/Jurgen/.taco_home/remote-builds/taco-remote/builds/66415/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 2 1> You may not have the required environment or OS to build this project (TaskId:10) 1> Failed to build app for buildNumber 66415: /Users/Jurgen/.taco_home/remote-builds/taco-remote/builds/66415/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 2 (TaskId:10) 1>22:57:03.377 1> 1>Error : Remote build error from the build server Build failed with error /Users/Jurgen/.taco_home/remote-builds/taco-remote/builds/66415/cordovaApp/platforms/ios/cordova/build: Command failed with exit code 2: {1} 1> Done executing task "MdaVsCli" -- FAILED. (TaskId:10) 1>22:57:03.393 1> 1>Done building target "BuildMDA" in project "MobileAppNew.jsproj" -- FAILED.: (TargetId:11)

Full Output:

https://www.wetransfer.com/downloads/b9a4e2e932f98bb2286fbb6602c8dfc020160523210524/48dffd

We are planning to send the app to iOS to be released on the App Store but cannot do the .ipa file. Any help would be appreciated

Jurgen Cuschieri
  • 658
  • 14
  • 33
  • Try updating your phonegap-plugin-push and cordova-plugin-inappbrowser plugins to the latest version in your project.See if build successfully, if not, could you share a basic demo that can reproduce this problem? – Elvis Xia - MSFT May 25 '16 at 06:32
  • I am going to try this now and get back. When building with remote build in release mode, what setting can you choose to only get the .ipa file and not actually deploy on an iOS device? I dont currently have an iOS device which I can test on. I will try update the plugins but the reason I still have version of push plugin 1.5.3 is because when I tried updating it I was getting other deployment problems (which I had previously posted about and got no reply - simply going back to the version 1.5.3 got rid of the problems - but right then I was not building in release mode but debug) – Jurgen Cuschieri May 25 '16 at 08:09
  • Somehow I am managing to build until I try to deploy. It's telling me to check my Provisioning profile. When building as usual the signing dialog comes up (3x), which I accept. I read somewhere that with release mode you cant deploy with remote build. So I tried installing the .ipa file using diawi.com - After seemingly installing 100% I get a can't install message. Could this be because of the prov profile? I dont think the release provisioning profile needs to be installed on the device right? Otherwise, this defies the point of a release version. I think it should be bundled with the app. – Jurgen Cuschieri May 25 '16 at 20:00
  • To run your app on an ios device, Provisioning profile is necessary, I would like to suggest you go through "To run your app on an iOS device" section of this [document](http://taco.visualstudio.com/en-us/docs/run-app-ios/). And here is the document that tells how to create a provisioning profile: [Create a provisioning profile](http://taco.visualstudio.com/en-us/docs/ios-guide/#create-a-provisioning-profile). – Elvis Xia - MSFT May 26 '16 at 01:38
  • I obviously created the release certificate and the prov profile on the app id related to the bundle identifier of the app. I downloaded it into X-Code and it can be seen in Preferences/View Details. When trying to deploy, half way through, a dialog pops up asking to use the keychain to sign the app with the certificate. This comes up 3x - which I accept. At the very end the deployment via remote build fails, no specific errors but the output gives the message 'Check your prov profile'. Since I have a release prov profile I dont know what to check for. Any help would be appreciated – Jurgen Cuschieri May 26 '16 at 06:50
  • Try copy the ios project in cordova project folder->platforms->ios to your mac, and deploy it through xcode, if the error persists, try clear all the provisioning profiles in your mac, use your app id and release certificate to create a new provisioning profile and deploy. – Elvis Xia - MSFT May 26 '16 at 08:55
  • The latest problem with the provisioning profile was trying to use an 'App Store' provisioning profile. Apparently, with such a provprofile you cant deploy the app through remote build. To use a release provisioning profile and still be able to deploy and test I figured I must use an ad-hoc prov profile. Right there it worked! However, a new problem was introduced on Android. Command failed with exit code 2 as error. And in the output: You may not have the required environment or OS to run this project. In reality I solved a problem but ran abruptly into another! – Jurgen Cuschieri May 26 '16 at 13:46
  • So I ran: npm install -g cordova, and then went into the directory cordova platform remove android and cordova plaform add android. I uninstalled the app from my Android device before trying to re-deploy it. But same error again. Any help would be appreciated. This is tiring! – Jurgen Cuschieri May 26 '16 at 13:47

1 Answers1

0

How I solved this problem:

First of all I didn't manage to build and deploy on a device when using the App Store Production Certificate. I did manage however with the Ad hoc certificate, which is a production certificate with the only difference that you still have to specify the UDID of the devices you will deploy on in the developer account.

I then updated my Cordova version from 5.3.1 to 6.2.0. I updated 2 outdated plugins: Inappbrowser and Phonegap-plugin-push and voila; the app suddenly started to deploy in release mode (via a taco remote build). Weird bit is that I had been using the old version of cordova and never had to update the plugins when running in Debug mode - which was why it took me a bit more time to figure it out! Good luck :)

Jurgen Cuschieri
  • 658
  • 14
  • 33