arlg
arlg

Reputation: 1138

Cordova doesn't work with iOS Multiple targets

Cordova iOS: 3.8.0 Cordova: 5.1.1

I have to create two additional targets (with different bundle id) to my project. When I do this, and when I do:

$ cordova prepare ios

I have this error in my Terminal:

could not find -Info.plist file, or config.xml file

Do I need to create a different config.xml file for each target? If yes, how should i do this?


Steps to do to reproduce the "bug":

  1. Create an empty HelloWorld project:

    cordova create hello com.example.hello HelloWorld

    cordova platforms add ios

  2. Open the project in xcode, duplicate a target.

  3. Then do, for example:

    cordova plugin add cordova-plugin-inappbrowser

The plugin will not get installed because of the same error.

Upvotes: 9

Views: 2108

Answers (2)

Ivan Yakovenko
Ivan Yakovenko

Reputation: 41

Apparently Cordova has problems with multiple targets.

There is a pull request with a fix: https://github.com/apache/cordova-lib/pull/219

Until Codova fixes this issue, here's a manual workaround:

  1. fetch the patched cordova-lib:

git clone http://github.com/ogoguel/cordova-lib

  1. edit /usr/local/lib/node_modules/cordova/package.json to use the patched version:

replace:

"dependencies": {

"cordova-lib": "5.0.0",

with

"dependencies": {

"cordova-lib": "file:PATH_TO_PATCHED_LIB/cordova-lib/cordova-lib",

(PATH_TO_PATCHED_LIB - should be the absolute path to the cordva-lib folder that you cloned in step 1)

  1. update npm installation:

cd /usr/local/lib/node_modules/cordova

sudo npm install

Upvotes: 4

Max
Max

Reputation: 373

Did you check out this tools ? http://tarifa.tools/

It's a powerful layer above cordova that enable multi app IDs generation (i.e. 1 for testing / 1 for the client / 1 for production...)

Upvotes: -1

Related Questions