1
votes

When attempting to build or debug an iOS Cordova app from Visual Studio 2015, using the latest version of Visual Studio Tools for Apache Cordova (14.0.50902.4), I bump into an issue where any folder with the name "plugins" will be omitted from within www directory during building via remotebuild on my Mac.

The actual cordova's "plugins" directory which is outside of the www folder is unaffected.

Steps to reproduce -

  1. On the Mac, Open Terminal and run remotebuild
  2. From PC, trigger an iOS build or debug via Visual Studio with a Cordova project opened.
  3. On the Mac, open another Terminal and go to the folder holding the remote build files sent from Visual Studio to remotebuild for building -

/Users/someuser/.taco_home/remote-builds/taco-remote/builds/xxxxx/cordovaApp/

Then I can see the normal "plugins" folder for cordova. But other plugins folder within www folder will be missing.

Found this issue when a cordova app I am currently working on became blank after we have upgraded to latest version of the cordova tools and visual studio (was working when using visual studio 2013)

Has anyone come across this recently?

Also, if I update the name of the "plugins" folder to be uppercase "Plugins" - then there will be no issues and the folder and the files within will be sent to the Mac / remotebuild for building :P This works if there are only 1 or 2 plugins folder that I have created myself, but we also have third party javascript libraries that gets pulled down using bower, and these libraries that have plugins folder will cause issues (e.g. we use Durandaljs which have its own plugins folder too)

I have followed the instructions to install remotebuild onto my Mac using this link - https://msdn.microsoft.com/library/dn757054(v=vs.140).aspx#ios

Thanks in advance.

3

3 Answers

0
votes

Thanks for using our VS tools for Apache Cordova and reporting the issue. Its a legitimate issue with the way remotebuild works and we fixing this issue in our next release (which will be soon out). Look out for the release on the npm for remotebuild. Till then please workaround the issue by renaming the "plugins" folder to something else.

Thanks, SOak.

0
votes

I installed the Cordova Tools Update 3 a couple of days ago and have had this issue as well. Android plugins compile fine, but iOS plugins are missing.

On the Mac, I'm running these versions:

Xcode: 6.4
Cordova: 5.3.3
node: 0.10.40
remotebuild: 2.0.1
taco-remote-multiplexer: 1.1.1
taco-remote-lib: 1.1.1

Here's what I've tried so far:

  • Uninstall/reinstall the tools on the Windows side
  • Updated the tools on the Mac side
  • Removing and re-adding the iOS platform to the Cordova project
  • Removing and re-adding all plugins
  • Renaming the plugins folder to Plugins in the project
  • Created a brand new Cordova project in Visual Studio with plugins
  • Manually deleting the contents of the platforms folder within the project and deleting the ios.json and ios_remote.json files within the plugins folder of the project

Here's what I've noticed:

  • When I do a build in Visual Studio, the app's .tgz file which is transmitted to the Mac does include my plugins, but the Xcode project does not include any of the plugins (not missing, just not included at all). The build succeeds, but app functionality is reduced due to lack of plugins (no camera, no Keychain).
  • Running in secure mode does not work on my Mac after updating. I have to disable secure mode in the config file and in Visual Studio's settings to get it to connect successfully. Turning on secure mode results in this VS2015 error: The underlying connection was closed: An unexpected error occurred on a send.
  • The remote-builds/taco-remote/builds/xxxxx/cordovaApp/plugins directory only has the ios.json file.
  • The remote-builds/taco-remote/builds/xxxxx/cordovaApp/platforms/ios/myappname/Plugins only has a README file.
  • Previous to Update 3, both of these directories would be full of plugin code files.
  • The cordova_plugins.js file previously had a long list of plugin information, but now only contains this:

    cordova.define('cordova/plugin_list', function(require, exports, module) {
    module.exports = [];
    module.exports.metadata = 
    // TOP OF METADATA
    {}
    // BOTTOM OF METADATA
    });
    

    Modifying this file does nothing as the build process appears to dynamically include the plugin information and revert it back to this after editing.

Is there a manual workaround to get these included in the iOS build? What else can we do to help troubleshoot this issue?

UPDATE: I didn't undo my test rename of the plugins folder to Plugins within the project and did a Clean then Rebuild. Now the plugins appear to be copying over to iOS correctly. I guess the lesson in my case is to always do a Rebuild, not an incremental Build, when troubleshooting Cordova app issues like this.

0
votes

Dan's answer made my day!

For me renaming the plugins folder to Plugins did the magic.

In case you're using Visual Studio to build your .ipa the easiest way to verify that plugins are not omitted is renaming the extension of .ipa to .zip and opening it in any archiving software. There just navigate to Payload\<your app id>.app\www folder. If you see there plugins folder you're cool, if not - plugins will not be available in your iOS app.

Hope it helps someone.