gpt4 book ai didi

ios - cordova 'NSInternalInconsistencyException',原因 : 'ERROR: config. xml 不存在

转载 作者:可可西里 更新时间:2023-11-01 04:41:04 27 4
gpt4 key购买 nike

我正在尝试为 ios 运行一个新的 hello world cordova 应用程序。它在初始屏幕上不断崩溃。

但是我总是报错

'NSInternalInconsistencyException',原因:'错误:config.xml 不存在。请运行 cordova-ios/bin/cordova_plist_to_config_xml path/to/project.

当我导航到 hellocordva.xcodeproj 并运行时

运行 cordova-ios/bin/cordova_plist_to_config_xml 。 它不是命令

这是 testapp/platforms/ios/HelloCordova 旁边的 config.xml 的样子

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap="http://phonegap.com/ns/1.0">
<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="SuppressesLongPressGesture" value="false" />
<preference name="Suppresses3DTouchGesture" value="false" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<feature name="HandleOpenUrl">
<param name="ios-package" value="CDVHandleOpenURL" />
<param name="onload" value="true" />
</feature>
<feature name="IntentAndNavigationFilter">
<param name="ios-package" value="CDVIntentAndNavigationFilter" />
<param name="onload" value="true" />
</feature>
<feature name="GestureHandler">
<param name="ios-package" value="CDVGestureHandler" />
<param name="onload" value="true" />
</feature>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<name>HelloCordova</name>
<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" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
</widget>

这是testapp根目录下的config.xml文件

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:gap = "http://phonegap.com/ns/1.0">
<name>HelloCordova</name>
<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" />
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>

这是 xcode 中的完整错误消息,以防有帮助

2016-03-23 09:04:35.758 HelloCordova[7284:185520] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/ibraheemabukhdair/Library/Developer/CoreSimulator/Devices/364F5298-04FE-4875-BE94-DEF9F74EA607/data/Containers/Data/Application/AD59ED2C-1BA5-4639-9260-CFF211D7C527/Library/Cookies/io.cordova.hellocordova.binarycookies
2016-03-23 09:04:35.803 HelloCordova[7284:185520] Apache Cordova native platform version 4.0.1 is starting.
2016-03-23 09:04:35.803 HelloCordova[7284:185520] Multi-tasking -> Device: YES, App: YES
2016-03-23 09:04:35.803 HelloCordova[7284:185520] *** Assertion failure in -[MainViewController parseSettingsWithParser:], /Users/ibraheemabukhdair/components/cordova/testapp/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m:149
2016-03-23 09:04:35.805 HelloCordova[7284:185520] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'ERROR: config.xml does not exist. Please run cordova-ios/bin/cordova_plist_to_config_xml path/to/project.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106eb1d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001068fcdeb objc_exception_throw + 48
2 CoreFoundation 0x0000000106eb1bea +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000106546d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 HelloCordova 0x00000001063b405e -[CDVViewController parseSettingsWithParser:] + 478
5 HelloCordova 0x00000001063b42fe -[CDVViewController loadSettings] + 110
6 HelloCordova 0x00000001063b38a9 -[CDVViewController __init] + 1017
7 HelloCordova 0x00000001063b3962 -[CDVViewController initWithNibName:bundle:] + 162
8 HelloCordova 0x00000001063b30a9 -[MainViewController initWithNibName:bundle:] + 121
9 HelloCordova 0x00000001063b3abe -[CDVViewController init] + 62
10 HelloCordova 0x00000001063b315e -[MainViewController init] + 62
11 HelloCordova 0x00000001063b2fa3 -[AppDelegate application:didFinishLaunchingWithOptions:] + 115
12 UIKit 0x0000000107a869ac -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 272
13 UIKit 0x0000000107a87c0d -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3415
14 UIKit 0x0000000107a8e568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1769
15 UIKit 0x0000000107a8b714 -[UIApplication workspaceDidEndTransaction:] + 188
16 FrontBoardServices 0x000000010c4b58c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
17 FrontBoardServices 0x000000010c4b5741 -[FBSSerialQueue _performNext] + 178
18 FrontBoardServices 0x000000010c4b5aca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
19 CoreFoundation 0x0000000106dd7301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
20 CoreFoundation 0x0000000106dcd22c __CFRunLoopDoSources0 + 556
21 CoreFoundation 0x0000000106dcc6e3 __CFRunLoopRun + 867
22 CoreFoundation 0x0000000106dcc0f8 CFRunLoopRunSpecific + 488
23 UIKit 0x0000000107a8af21 -[UIApplication _run] + 402
24 UIKit 0x0000000107a8ff09 UIApplicationMain + 171
25 HelloCordova 0x00000001063b2f11 main + 65
26 libdyld.dylib 0x0000000109d5392d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

最佳答案

您可以通过将 config.xml 添加到 Targets>Build Phases>Copy Bundle Resources

来解决此问题

关于ios - cordova 'NSInternalInconsistencyException',原因 : 'ERROR: config. xml 不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36179017/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com