2014-03-06 42 views
1

在模擬器上運行我的應用程序效果很好。試圖通過XCode中安裝的應用程序,在設備上運行的應用程序顯示了啓動圖像,然後將失敗,NSInternalInconsistencyException', reason: 'config.xml parse error line 43 col 23'PhoneGap iOS應用程序無法在設備上啓動 - config.xml解析錯誤

線43是 <gap:platform name="ios" />

當我刪除該行它給出了同樣的錯誤具有相同的線數字(指向文件的下一行)。這表明錯誤在第43行之前。我在配置文件中插入了隨機行,並驗證行數發生了變化,所以這是正確的config.xml文件。

我重新排序了一些標籤(即功能標籤和名稱),但沒有區別。 我已經完全刪除platforms/ios文件夾,並已在我的本地機器上重建。

這裏就是整個的XCode輸出

2014-03-06 16:16:51.896 GetGrounded[299:907] Multi-tasking -> Device: YES, App: YES 
2014-03-06 16:16:51.922 GetGrounded[299:907] *** Assertion failure in -[CDVConfigParser parser:parseErrorOccurred:], /Users/anthonyelliott/Documents/code/simplicitymaximized/get-grounded/platforms/ios/CordovaLib/Classes/CDVConfigParser.m:85 
2014-03-06 16:16:51.927 GetGrounded[299:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'config.xml parse error line 43 col 23' 
*** First throw call stack: 
(0x311a32a3 0x38e2397f 0x311a315d 0x31a78ab7 0xab701 0x31abfa13 0x39120c5b 0x39133dcb  0x39139817 0x3913b0cd 0x3913aced 0x31abf937 0x31abf8e1 0x31abfb35 0x31abfbcb 0x9d895 0x9cd77  0x9ce3b 0xafff5 0x9cf99 0xb009d 0xaf97b 0x3300bad9 0x3300b663 0x3300384b 0x32fabc39 0x32fab6cd  0x32fab11b 0x34c9d5a3 0x34c9d1d3 0x31178173 0x31178117 0x31176f99 0x310e9ebd 0x310e9d49  0x33002485 0x32fff301 0xaf5b7 0xaf578) 
libc++abi.dylib: terminate called throwing an exception 
(lldb) 

這是我的完整的config.xml文件。一切看起來都不錯,任何人有任何想法我做錯了什麼?

<?xml version='1.0' encoding='utf-8'?> 
<widget id="com.simplicitymaximized.getgrounded" version="1.0.0" xmlns="http://www.w3.org/ns/widgets"> 
<name>GetGrounded</name> 
<preference name="AllowInlineMediaPlayback" value="false" /> 
<preference name="BackupWebStorage" value="cloud" /> 
<preference name="DisallowOverscroll" value="false" /> 
<preference name="EnableViewportScale" value="false" /> 
<preference name="KeyboardDisplayRequiresUserAction" value="true" /> 
<preference name="MediaPlaybackRequiresUserAction" value="false" /> 
<preference name="SuppressesIncrementalRendering" value="false" /> 
<preference name="TopActivityIndicator" value="gray" /> 
<preference name="GapBetweenPages" value="0" /> 
<preference name="PageLength" value="0" /> 
<preference name="PaginationBreakingMode" value="page" /> 
<preference name="PaginationMode" value="unpaginated" /> 
<description> 
    A sample Apache Cordova application that responds to the deviceready event. 
</description> 
<author email="[email protected]" href="http://cordova.io"> 
    Apache Cordova Team 
</author> 
<content src="index.html" /> 
<feature name="LocalStorage"> 
    <param name="ios-package" value="CDVLocalStorage" /> 
</feature> 
<access origin="*" /> 
<preference name="useBrowserHistory" value="true" /> 
<preference name="exit-on-suspend" value="false" /> 
<preference name="permissions" value="none" /> 
<preference name="orientation" value="default" /> 
<preference name="target-device" value="universal" /> 
<preference name="fullscreen" value="false" /> 
<preference name="webviewbounce" value="true" /> 
<preference name="prerendered-icon" value="false" /> 
<preference name="stay-in-webview" value="false" /> 
<preference name="ios-statusbarstyle" value="black-opaque" /> 
<preference name="detect-data-types" value="true" /> 
<preference name="show-splash-screen-spinner" value="true" /> 
<preference name="auto-hide-splash-screen" value="true" /> 
<preference name="disable-cursor" value="false" /> 
<preference name="android-minSdkVersion" value="7" /> 
<preference name="android-installLocation" value="auto" /> 
<gap:platform name="ios" /> 
<gap:platform name="android" /> 
</widget> 

回答

2

我能夠通過生成了新的config.xml一個新的PhoneGap項目和複製到我的項目,以解決這個問題(然後更改了名字和ID)。不知道我的文件究竟出了什麼問題,但它現在起作用了。

+2

我想你錯過了widget標籤的'xmlns:gap =「http://phonegap.com/ns/1.0」'部分。 – QuickFix

+0

在widget標籤中添加xmlns:gap =「http://phonegap.com/ns/1.0」,將解決錯誤。謝謝@QuickFix –

相關問題