2014-03-06 41 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 –

相关问题