2016-08-23 99 views
1

我正在使用Cordova 6.3.1。 嘗試使用Cordova CLI構建到iOS時出現如下所示的問題。 $ cordova build ios Cordova不會生成 - Platform Config.xml不正確

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 [email protected] 
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 [email protected] 
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並使用Sencha Cmd與$sencha app build native一起構建,該文件啓動了原始Cordova項目文件夾。

回答

0

cordova plugins --list 打開x-code找到這些插件 也許cordova插件列表有一些插件,但ios項目不是。

,你可以將它刪除DIY,再次 platform > ios > fecth.json or ios.json or package.json 希望有所幫助

對不起安裝,我不擅長英語。

0

對於我這個職位的解決方案擬定: Cordova pruning error for android config xml

您必須刪除所有插件和平臺,更新科爾多瓦然後再添加的所有插件和平臺。清理插件和我的iOS平臺我寫了一個腳本NPM:

{ 
    ... 
    "rm-plugins": "cordova plugins list | awk '{print $1}' | xargs cordova plugins rm", 
    "rm-platforms": "cordova platforms remove ios", 
    "cleanup": "npm run rm-platforms && npm run rm-plugins && npm update cordova" 
    ... 
} 

PS:我沒有完全按照你有同樣的錯誤消息:

Error: Pruning at selector "/*/plugins" from "/Users/Thomas/work/repos/nexboard/iOS/nexboard/platforms/ios/neXboard/config.xml" went bad.