【发布时间】:2016-08-23 08:22:38
【问题描述】:
我正在使用 Cordova 6.3.1。
尝试使用 Cordova CLI 构建到 iOS 会出现如下所示的问题。
$ cordova build ios
Error: Pruning at selector "/widget/plugins" from "/Users/path/to/cordova/project/cordova/platforms/ios/Myproj/config.xml" went bad.
更新平台时我也遇到同样的错误:
$ cordova platform update ios
Updating ios project...
iOS project updated with cordova-ios@4.2.1
Error: Pruning at selector "/widget/plugins" from "/Users/path/to/cordova/project/cordova/platforms/ios/Myproj/config.xml" went bad.
1) 这个剪枝错误到底是什么意思?
我注意到位于 cordova/platforms/ios/Myproj/ 中的 config.xml 不包含来自我的根 config.xml 的任何信息。它只是像这样开始的默认文件:
<widget xmlns = "http://www.w3.org/ns/widgets"
id = "io.cordova.helloCordova"
version = "2.0.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
我的根 config.xml 文件是这样开始的:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.myproj.app" version="1.0.38" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Myproj</name>
<description>
Some description.
</description>
同时,当我执行以下添加平台时,安装似乎很好:
$ cordova platform add ios
Adding ios project...
Creating Cordova project for the iOS platform:
Path: ../../../../../desktop/dev/path/to/my/project/cordova/platforms/ios
Package: com.myproj.app
Name: Myproj
iOS project created with cordova-ios@4.2.1
Installing "com.mbppower.camerapreview" for ios
Installing "com.phonegap.plugins.PushPlugin" for ios
Installing "cordova-plugin-device" for ios
Installing "cordova-plugin-globalization" for ios
Installing "com.telerik.plugins.healthkit" for ios
Installing "com.transistorsoft.cordova.background-geolocation" for ios
Installing "cordova-plugin-dialogs" for ios
Installing "cordova-plugin-background-fetch" for ios
Installing "cordova-plugin-afnetworking" for ios
Plugin "cordova-plugin-background-fetch" already installed on ios. Making it top-level.
Installing "cordova-plugin-camera" for ios
Installing "cordova-plugin-compat" for ios
Dependent plugin "cordova-plugin-compat" already installed on ios.
Installing "cordova-plugin-console" for ios
Plugin "cordova-plugin-device" already installed on ios. Making it top-level.
Plugin "cordova-plugin-dialogs" already installed on ios. Making it top-level.
Installing "cordova-plugin-file" for ios
Dependent plugin "cordova-plugin-compat" already installed on ios.
The Android Persistent storage location now defaults to "Internal". Please check this plugins README to see if you application needs any changes in its config.xml.
If this is a new application no changes are required.
If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:
"<preference name="AndroidPersistentFileLocation" value="Compatibility" />"
to config.xml in order for the application to find previously stored files.
Installing "cordova-plugin-file-transfer" for ios
Dependent plugin "cordova-plugin-file" already installed on ios.
Installing "cordova-plugin-geolocation" for ios
Dependent plugin "cordova-plugin-compat" already installed on ios.
Dependent plugin "cordova-plugin-globalization" already installed on ios.
Installing "cordova-plugin-http" for ios
Dependent plugin "cordova-plugin-file" already installed on ios.
Installing "cordova-plugin-inappbrowser" for ios
Installing "cordova-plugin-media-capture" for ios
Dependent plugin "cordova-plugin-file" already installed on ios.
Dependent plugin "cordova-plugin-compat" already installed on ios.
Installing "cordova-plugin-pedometer" for ios
Installing "cordova-plugin-photokandy-video-thumbnail" for ios
Dependent plugin "cordova-plugin-file" already installed on ios.
Installing "cordova-plugin-whitelist" for ios
Installing "phonegap-plugin-barcodescanner" for ios
2) 平台安装如何工作?更具体地说,它如何告诉平台特定的 config.xml 中应该包含什么?
我希望可以在使我的构建运行的上下文中回答这些问题。其他一些背景信息:我正在使用 Sencha Touch 并使用启动原始 Cordova 项目文件夹的 Sencha Cmd 与 $sencha app build native 一起构建。
【问题讨论】:
标签: ios cordova build sencha-touch sencha-cmd