Cordova不支持iOS多个目标 [英] Cordova doesn't work with iOS Multiple targets

查看:146
本文介绍了Cordova不支持iOS多个目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cordova iOS: 3.8.0
Cordova: 5.1.1



创建两个额外的目标(具有不同的bundle id)到我的项目。当我这样做,当我做:

  $ cordova prepare ios 

我在我的航站楼有这个错误:

 找不到-Info.plist文件或config.xml文件

我需要创建不同的配置.xml文件为每个目标?如果是,我该如何做?






重现bug的步骤:


  1. 创建一个空HelloWorld项目:



    cordova create hello com.example.hello HelloWorld



    cordova platforms add ios

    / li>
  2. 在xcode中打开项目,复制目标。


  3. cordova插件add cordova-plugin-inappbrowser


$

解决方案

显然Cordova有



有一个pull请求,其中包含一个修复: https://github.com/apache/cordova-lib/pull/219



直到Codova修复这个问题,以下是一个手动解决方法:


  1. 获取修补的cordova-lib:

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


  1. 编辑 /usr/local/lib/node_modules/cordova/package.json 使用修补版本:

replace:


依赖关系:{



cordova-lib:5.0.0,



dependencies:{



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


(PATH_TO_PATCHED_LIB - 您在步骤1中克隆的cordva-lib文件夹的绝对路径


  1. 更新npm安装:

cd / usr / local / lib / node_modules / cordova



sudo npm install


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.

解决方案

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

这篇关于Cordova不支持iOS多个目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆