PhoneGap iOS应用程序无法仅在设备上启动 - config.xml解析错误

时间:2014-03-06 22:27:29

标签: cordova

在模拟器上运行我的应用效果很好。尝试通过XCode在设备上运行应用程序会安装应用程序,显示启动图像,然后失败并显示NSInternalInconsistencyException', reason: 'config.xml parse error line 43 col 23'

第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="dev@cordova.apache.org" 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>

1 个答案:

答案 0 :(得分:2)

我能够通过生成一个新的phonegap项目并将新的config.xml复制到我的项目(然后更改名称和ID)来解决这个问题。不确定我的文件究竟出了什么问题,但它现在有效。