Hi everybody,
This time I really hit a road block. This time, I’m stopped by an Xcode error which I do now know how to deal with.
Quick background:
my app works as expected when I do
ionic serve --lab
That is to say that I can see both the android nd the ios counterparts work perfectly fine.
my app also works as expected when I do
ionic build android
and
ionic emulate android
My app also works when I run it actually on device that is my android phone.
So there are no issues as far as android side is concerned.
The problem is my app does NOT work when it comes to ios.
For example, ionic emulate ios
gives me a white screen with an ionic logo in the center and after staying less than a sec, it terminates itself.
To see some error messages what causes this, I run it thru Xcode. Same thing happened. We also put it actually on an iPhone. No luck… it just gets either stuck on the screen or terminates itself.
The error message Xcode generates is as follows - which I have no idea how to deal with as it is Objective C or Swift code with no indication to me as to what part of JS / HTML code is causing this.
It bombs at this line:
int retVal = UIApplicationMain(argc, argv, nil, @“AppDelegate”);
this line is in the main.m.
full main.m is as follows
#import <UIKit/UIKit.h>
int main(int argc, char* argv[])
{
@autoreleasepool {
int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
return retVal;
}
}
That line causes this error:
*** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: '[<UIApplication 0x7fcec3601fd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
The full console message is as follows;
2016-01-14 14:46:58.285 My App[29961:1688281] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/Haluk/Library/Developer/CoreSimulator/Devices/77C25BC1-33AA-40B0-B32F-17DA0756711B/data/Containers/Data/Application/B7521295-127E-4390-812B-2C0BE5C56EBF/Library/Cookies/com.ionicframework.demoapp703628.binarycookies
2016-01-14 14:46:58.339 My App[29961:1688281] *** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[<UIApplication 0x7fcec3601fd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.’
*** First throw call stack:
(
0 CoreFoundation 0x0000000110020e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000112993deb objc_exception_throw + 48
2 CoreFoundation 0x0000000110020aa9 -[NSException raise] + 9
3 Foundation 0x00000001125609bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
4 UIKit 0x000000011078af41 -[UIRuntimeOutletConnection connect] + 109
5 CoreFoundation 0x000000010ff614a0 -[NSArray makeObjectsPerformSelector:] + 224
6 UIKit 0x0000000110789924 -[UINib instantiateWithOwner:options:] + 1864
7 UIKit 0x000000011078bb5b -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 223
8 UIKit 0x00000001103ccef8 -[UIApplication _loadMainNibFileNamed:bundle:] + 57
9 UIKit 0x00000001103cd2d6 -[UIApplication _loadMainInterfaceFile] + 260
10 UIKit 0x00000001103cbb54 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1390
11 UIKit 0x00000001103c8e7b -[UIApplication workspaceDidEndTransaction:] + 188
12 FrontBoardServices 0x00000001137a8754 -[FBSSerialQueue _performNext] + 192
13 FrontBoardServices 0x00000001137a8ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
14 CoreFoundation 0x000000010ff4ca31 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
15 CoreFoundation 0x000000010ff4295c __CFRunLoopDoSources0 + 556
16 CoreFoundation 0x000000010ff41e13 __CFRunLoopRun + 867
17 CoreFoundation 0x000000010ff41828 CFRunLoopRunSpecific + 488
18 UIKit 0x00000001103c87cd -[UIApplication _run] + 402
19 UIKit 0x00000001103cd610 UIApplicationMain + 171
20 My App 0x000000010fdb9151 main + 65
21 libdyld.dylib 0x00000001132b092d start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any idea what could be causing this?