以NSException类型的未捕获异常终止

时间:2015-12-18 19:29:57

标签: ios objective-c xcode cordova

我目前是Xcode和IOS的新手,我在Xcode中打开了一个完成的项目,但是当我尝试运行该项目时,我得到了这些错误:

    2015-12-18 20:05:49.729 Arsene[7069:78785] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/Refresh/Library/Developer/CoreSimulator/Devices/D1119725-6C13-49FE-A46E-808147418747/data/Containers/Data/Application/AF3B04B0-7A18-44C9-9ADB-3FD2A953F01C/Library/Cookies/Codeators.binarycookies
2015-12-18 20:05:49.808 Arsene[7069:78785] Apache Cordova native platform version 3.8.0 is starting.
2015-12-18 20:05:49.809 Arsene[7069:78785] Multi-tasking -> Device: YES, App: YES
2015-12-18 20:05:49.809 Arsene[7069:78785] *** Assertion failure in -[MainViewController loadSettings], /Users/Refresh/Downloads/arsne_v113/app/platforms/ios/CordovaLib/Classes/CDVViewController.m:172
2015-12-18 20:05:49.814 Arsene[7069:78785] *** 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                      0x00573a14 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x03875e02 objc_exception_throw + 50
    2   CoreFoundation                      0x005738aa +[NSException raise:format:arguments:] + 138
    3   Foundation                          0x034f3d26 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
    4   Arsene                              0x000c7867 -[CDVViewController loadSettings] + 519
    5   Arsene                              0x000c6de6 -[CDVViewController __init] + 1286
    6   Arsene                              0x000c6eae -[CDVViewController initWithNibName:bundle:] + 190
    7   Arsene                              0x000b7842 -[MainViewController initWithNibName:bundle:] + 146
    8   UIKit                               0x00aca332 -[UIViewController init] + 49
    9   Arsene                              0x000c7057 -[CDVViewController init] + 71
    10  Arsene                              0x000b7914 -[MainViewController init] + 68
    11  Arsene                              0x000b6e49 -[AppDelegate application:didFinishLaunchingWithOptions:] + 505
    12  UIKit                               0x008f9172 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 337
    13  UIKit                               0x008fa5a0 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3863
    14  UIKit                               0x00901cd6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1989
    15  UIKit                               0x00926ee5 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3218 + 68
    16  UIKit                               0x008fe966 -[UIApplication workspaceDidEndTransaction:] + 163
    17  FrontBoardServices                  0x04556c76 __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
    18  FrontBoardServices                  0x0455674d __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
    19  FrontBoardServices                  0x04574173 -[FBSSerialQueue _performNext] + 184
    20  FrontBoardServices                  0x045745aa -[FBSSerialQueue _performNextFromRunLoopSource] + 52
    21  FrontBoardServices                  0x045738a6 FBSSerialQueueRunLoopSourceHandler + 33
    22  CoreFoundation                      0x0048d6ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
    23  CoreFoundation                      0x0048338b __CFRunLoopDoSources0 + 523
    24  CoreFoundation                      0x004827a8 __CFRunLoopRun + 1032
    25  CoreFoundation                      0x004820e6 CFRunLoopRunSpecific + 470
    26  CoreFoundation                      0x00481efb CFRunLoopRunInMode + 123
    27  UIKit                               0x008fe206 -[UIApplication _run] + 540
    28  UIKit                               0x00903bfa UIApplicationMain + 160
    29  Arsene                              0x000b6a99 main + 89
    30  libdyld.dylib                       0x0406fa21 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)  

它将我发送到main.m文件,其中包含以下代码:

/*
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 */
//
//  main.m
//  Arsene
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//  Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//

#import <UIKit/UIKit.h>

int main(int argc, char* argv[])
{
    @autoreleasepool {
        int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
        return retVal;
    }
}

它指向行: int retVal = UIApplicationMain(argc,argv,nil,@“AppDelegate”);

我真的试图在这里找到任何解决方案,但找不到它,希望有人可以帮助我,并运行项目,也许我们可以在这里安排远程帮助

4 个答案:

答案 0 :(得分:1)

您的错误消息显示:

  

原因:&#39;错误:config.xml不存在。 请运行cordova-ios / bin / cordova_plist_to_config_xml路径/至/ project

即使您已经这样做了,也请再试一次。可能有帮助。

你所拥有的不是一个&#34;本地人&#34; iOS应用程序项目,但是使用Apache Cordova构建的混合应用程序。根据错误消息消息,看起来您的Cordova设置不完整。

您是否在计算机上安装了Cordova?如果没有,那么这个问题太大了,无法在这里得到解答,我很害怕。如果有,那么只需输入建议的命令&#34; cordova-ios/bin/cordova_plist_to_config_xml&#34;在应用程序所在文件夹中的终端上。在这种情况下,您的&#34;路径/到/项目&#34;将是.,即只是一个点(表示当前文件夹)

cordova-ios/bin/cordova_plist_to_config_xml path/to/project

文件CDVViewController.m不是您自己的代码,但属于Cordova。您自己的代码很可能是HTML,CSS和JS文件。

答案 1 :(得分:0)

在命令行中运行: cordova platform remove ios cordova platform add ios

答案 2 :(得分:0)

出于某种原因,当我将主界面设置为MainViewController.xib时,我得到了这个,这应该是正确的,但显然不是。如果我清除该字段,它将再次开始工作。

答案 3 :(得分:0)

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

来解决此问题。