2

Here are the issues I encountered and fixed:

  1. Code signing: downloaded the xcode8.js hook and added the following to build.json, per http://www.dpogue.ca/articles/cordova-xcode8.html:

    "ios": {
        "debug": {
            "developmentTeam": "VZ4B5XSP9U"
        },
        "release": {
            "developmentTeam": "VZ4B5XSP9U",
            "codeSignIdentity": "iPhone Developer"
        }
    }
    
  2. On my Mac, deleted the ~/.taco_home/node_modules/taco-remote-lib/2.2.1 and .../2.2.0 folders, per https://github.com/Microsoft/remotebuild/issues/5.

  3. On my Mac, tried uninstalling and reinstalling remotebuild, and different versions of node and npm (0.12.9 and 4.6, and respective npm versions).

  4. In Visual Studio, tried changing the targeted Cordova version: 6.3.1, 6.2, 6.1.1, and back to 5.4.1.

No matter what I do though, the build gets stuck either on extracted - Extracted app contents from uploaded build request, or building - Updating platform forever.

Earlier, when I tried opening the Xcode project in Xcode on the Mac, it successfully built and deployed the app to the device. I was then facing issues using WebRTC (using cordova-plugin-iosrtc) and it was giving me privacy violation exceptions. I tried adding the cordova-custom-config plugin and appropriate Cocoa keys (NSCameraUsageDescription and NSMicrophoneUsageDescription) per App crashes with __CRASHING_DUE_TO_PRIVACY_VIOLATION__ when trying to access contacts, and then it stopped working altogether.

Can anyone please advise what are the latest versions of all of the components I should be using to make it work again? Some sources advise to use Node 0.12.9 on the Mac, others 0.12.7; most people claim that with Cordova >= 5.3.3, any Node version should suffice, however using Node 4.6 didn't work either.

Thanks in advance for any help!

Update: After performing the brew update etc. as suggested by Jordan, the remote deploy works, but the build sets "Main interface" setting under project's General tab to "NSMainNibFile~ipad", which causes the app to crash on launch, until I open the project in Xcode and clear that field, then an incremental build creates a functioning app.

Community
  • 1
  • 1
Mr. TA
  • 5,230
  • 1
  • 28
  • 35

1 Answers1

4

This is a known issue with Apache Cordova 6.3.1 and for the Visual Studio tools we've been working on a fix for this. To work around the issue for now, you'll need to perform the following steps:

  • Add a developmentTeam property to the ios build settings in your project's build.json file (an example is shown below).
  • Set the build.json file's codeSignIdentity property to the static value iPhone Developer.
  • Setup a before_compile hook in your project to copy the developmentTeam property into the project's platforms/ios/cordova/build.xcconfig file.

The project's build.json file should look something like the following:

{ "ios": { "debug": { "developmentTeam": "DEVELOPMENT_TEAM_NAME" }, "release": { "developmentTeam": "DEVELOPMENT_TEAM_NAME", "codeSignIdentity": "iPhone Developer" } } }

To simplify the process, Darryl Pogue published a sample hook that makes the required changes to the project's build.xconfig file based on the build.json example shown above. To use this hook, copy the sample xcode8.js file to your project's hooks folder, and then modify the project's config.xml to execute it before the compilation step using the following code:

<platform name="ios"> <hook type="before_compile" src="hooks/xcode8.js" /> </platform>

Creating a Distribution Build

At this point, the Cordova build process works, and you can run, test and debug your app. Unfortunately, the app isn't being signed with the correct development certificate needed for distribution. In order to sign them with a distribution certificate, you'll need to create an archive of the app by following the instructions found in: Uploading Your App to iTunes Connect.

iOS 10

Developers building Cordova applications for iOS 10 may encounter the following errors:

Http 404: Error mounting developer disk image Http 500: No devices found to debug. Please ensure that a device is connected and awake and retry.

This is caused by the Mac development environment needing an update to several modules. To fix the issue, on Mac OS, open a terminal window and issue the following command:

brew update && brew upgrade libimobiledevice --HEAD && brew upgrade ios-webkit-debug-proxy ideviceinstaller

Jordan Matthiesen
  • 1,480
  • 7
  • 17