Cordova不支持iOS多个目标 [英] Cordova doesn't work with iOS Multiple targets
问题描述
Cordova iOS: 3.8.0
Cordova: 5.1.1
创建两个额外的目标(具有不同的bundle id)到我的项目。当我这样做,当我做:
$ cordova prepare ios
我在我的航站楼有这个错误:
找不到-Info.plist文件或config.xml文件
我需要创建不同的配置.xml文件为每个目标?如果是,我该如何做?
重现bug的步骤:
-
创建一个空HelloWorld项目:
cordova create hello com.example.hello HelloWorld
cordova platforms add ios
-
在xcode中打开项目,复制目标。
-
cordova插件add cordova-plugin-inappbrowser
$
显然Cordova有
有一个pull请求,其中包含一个修复: https://github.com/apache/cordova-lib/pull/219
直到Codova修复这个问题,以下是一个手动解决方法:
- 获取修补的cordova-lib:
git clone http://github.com/ogoguel/cordova-lib
- 编辑 /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文件夹的绝对路径
- 更新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":
Create an empty HelloWorld project:
cordova create hello com.example.hello HelloWorld
cordova platforms add ios
Open the project in xcode, duplicate a target.
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:
- fetch the patched cordova-lib:
git clone http://github.com/ogoguel/cordova-lib
- 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)
- update npm installation:
cd /usr/local/lib/node_modules/cordova
sudo npm install
这篇关于Cordova不支持iOS多个目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!