Muli
Muli

Reputation: 214

terminating with uncaught exception of type NSException

Im currently new in Xcode and IOS, and I opened a finished project in Xcode but when i try to run the project i get these errors:

    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)  

And it sends me to the file main.m which has the following code:

/*
 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;
    }
}

It points to the row : int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

I really tried to find any solution here but couldn't find it, hope someone could help me out here, and run the project, maybe we can arrange also a remotely help here

Upvotes: 1

Views: 4163

Answers (4)

Balashekar
Balashekar

Reputation: 131

You can fix this issue by adding config.xml to Targets>Build Phases>Copy Bundle Resources

Upvotes: 0

Post Impatica
Post Impatica

Reputation: 16373

For some reason I get this when I set the Main Interface to MainViewController.xib which should be correct but apparently isn't. If I clear the field it starts working again.

Upvotes: 1

Łukasz Gierałtowski
Łukasz Gierałtowski

Reputation: 607

Run in the command line: cordova platform remove ios cordova platform add ios

Upvotes: -1

JOM
JOM

Reputation: 8197

Your error message says:

reason: 'ERROR: config.xml does not exist. Please run cordova-ios/bin/cordova_plist_to_config_xml path/to/project.

Even if you have done that already, try it again. Might help.

What you have is not a "native" iOS application project, but a hybrid application built with Apache Cordova. Based on error note message, it looks like your Cordova setup is not complete.

Have you installed Cordova on your machine? If not, then this question is way too big to be answered here, I'm afraid. If you have, then just type the suggested command "cordova-ios/bin/cordova_plist_to_config_xml" on terminal in the folder, where your app is located. In that case your "path/to/project" would be . i.e. just a dot (means current folder)

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

The file CDVViewController.m is not your own code, but belongs to Cordova. Your own code is most likely HTML, CSS and JS files.

Upvotes: 1

Related Questions