Cordova: Trying to find a way to disable Bitcode


#1

I am using Cordova plugins that do not support Bitcode, so I always have to manually set the EnableBitocde build settings to false.

I’m trying to find an automated way to do this. There is a promising npm package available here:
https://www.npmjs.com/package/cordova-plugin-disable-bitcode

This package itself requires the npm packages xcode, cordova-lib and cordova-common. So I tried to set-up a custom Meteor package like this:

Npm.depends({
  "xcode": "0.8.2",
  "cordova-lib": "5.4.1",
  "cordova-common": "1.0.0"
});

Cordova.depends({
  "cordova-plugin-disable-bitcode": "https://github.com/akofman/cordova-plugin-disable-bitcode/tarball/f67c76703bed45eefa4b69828abcf7fa145f2cab"
});

However, this does not work. The npm packages are downloaded, but the Cordova packages does not have access to them, it complains that it cannot find the xcode package (“Error: Cannot find module ‘xcode’”). Is there a trick to allow a Cordova build package to have access to certain npm packages?

Adding an Npm.require(‘xcode’) between the Npm.depends() and Cordova.depends() did not work, as Npm.require() only finds built-in npm modules if called inside package.js.


#2

You will also need to export() or imply() their use in the Package.onUse section so they are available for your app to use or to write some code for your package that does the bitcode switch in the package

alternatively, you could use meteorhacks:npm to use them directly


#3

@garilla: Thanks for your reply. How exactly do I export / imply an npm package this way?