Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova doesn't work with iOS Multiple targets

Tags:

xcode

ios

cordova

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.

like image 336
arlg Avatar asked Jul 06 '15 12:07

arlg


1 Answers

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

like image 91
Ivan Yakovenko Avatar answered Sep 18 '22 13:09

Ivan Yakovenko