We have tried to run WL 6.1 Fix Pack FP02 app on iOS 9 and got the following error in main.m file:
‘Application windows are expected to have a root view controller at the end of application launch’
The exception is thrown on this line of main.m:
int retVal = UIApplicationMain(argc, argv, appClass, #”MyAppDelegate”);
Any help would be greatly appreciated.
Below is the stack trace from xcode 7 :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
*** First throw call stack:
(
0 CoreFoundation 0x047e0a94 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0429fe02 objc_exception_throw + 50
2 CoreFoundation 0x047e092a +[NSException raise:format:arguments:] + 138
3 Foundation 0x00f0e3e6 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118
4 UIKit 0x012b3568 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3674
5 UIKit 0x012d6905 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3171 + 68
6 UIKit 0x012afbae -[UIApplication workspaceDidEndTransaction:] + 163
7 FrontBoardServices 0x07c1cccc __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
8 FrontBoardServices 0x07c1c7a3 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
9 FrontBoardServices 0x07c3a1cb -[FBSSerialQueue _performNext] + 184
10 FrontBoardServices 0x07c3a602 -[FBSSerialQueue _performNextFromRunLoopSource] + 52
11 FrontBoardServices 0x07c398fe FBSSerialQueueRunLoopSourceHandler + 33
12 CoreFoundation 0x046fae7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
13 CoreFoundation 0x046f0b0b __CFRunLoopDoSources0 + 523
14 CoreFoundation 0x046eff28 __CFRunLoopRun + 1032
15 CoreFoundation 0x046ef866 CFRunLoopRunSpecific + 470
16 CoreFoundation 0x046ef67b CFRunLoopRunInMode + 123
17 UIKit 0x012af497 -[UIApplication _run] + 540
18 UIKit 0x012b4cc1 UIApplicationMain + 160
19 MYAPP 0x00100f5d main + 157
20 libdyld.dylib 0x04c8ba21 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Update:
Tested with the provided Hello World project - failing
Tested with the latest available iFix - working
Please upgrade.
Without proper example that can be debugged it is difficult to answer, but it should be noted that for applications compiled with Xcode 7 to correctly function you need to make sure, at minimum, to make the following tweaks:
Disable Bitcode, as it is currently not supported.
Correctly define ATS (either allow all addresses, or correctly setup the client application with HTTPS, and the server with TLS 1.2 support).
Read more about ATS and Bitcode, here: https://developer.ibm.com/mobilefirstplatform/2015/09/09/ats-and-bitcode-in-ios9/
See if that resolves this issue. If not, you must provide an application with reproduction steps.
You should also note that 6.1 Fix Pack 2 is extremely old and you should, as an IBM customer, login to IBM Fix Central and download the latest available iFix (for Studio and Server) and upgrade. This latest iFix also contains iOS 9 related fixes, so it is advised to test with it first, in addition to the above required changes for applications compiled in Xcode 7.
From the provided example project, you are not even using Fix Pack 2, but 1. Even older...
Application windows are expected to have a root view controller at the end of application launch’
This error is caused when there is no view controller for the app to go to after the launch. This could be because you have not created one yet because you started with an empty application, you deleted the view controller, or it might be you deleted the entrance point to the main view controller.
Related
I am trying to build my Cordova app with Firebase integrated using Xcode build, but I am getting this vague error, and I can't understand what's wrong. I have placed the GoogleService-Info.plist file in the project directory, but it still fails to build. Here is the stack trace
2017-05-17 09:56:43.610 MyAppz[824:13611] *** Terminating app due to uncaught exception 'com.firebase.core',
reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist
or set in the customized options.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001099cdb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000109409141 objc_exception_throw + 48
2 CoreFoundation 0x0000000109a36625 +[NSException raise:format:] + 197
3 MyAppz 0x0000000107280b70 +[FIRApp addAppToAppDictionary:] + 371
4 MyAppz 0x000000010728011b +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 285
5 MyAppz 0x000000010727fe4f +[FIRApp configure] + 302
6 MyAppz 0x000000010721c59a -[AppDelegate(FirebasePlugin) application:swizzledDidFinishLaunchingWithOptions:] + 122
7 UIKit 0x000000010a804957 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
8 UIKit 0x000000010a80623c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4119
9 UIKit 0x000000010a80c584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
10 UIKit 0x000000010a809793 -[UIApplication workspaceDidEndTransaction:] + 182
11 FrontBoardServices 0x000000010fce15f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
12 FrontBoardServices 0x000000010fce146d -[FBSSerialQueue _performNext] + 186
13 FrontBoardServices 0x000000010fce17f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
14 CoreFoundation 0x0000000109973c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
15 CoreFoundation 0x00000001099590cf __CFRunLoopDoSources0 + 527
16 CoreFoundation 0x00000001099585ff __CFRunLoopRun + 911
17 CoreFoundation 0x0000000109958016 CFRunLoopRunSpecific + 406
18 UIKit 0x000000010a80802f -[UIApplication _run] + 468
19 UIKit 0x000000010a80e0d4 UIApplicationMain + 159
20 MyAppz 0x0000000107195df1 main + 65
21 libdyld.dylib 0x000000010cc3a65d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What could be the problem, I don't know what else to show if it's needed, so please ask.
For some reason Xcode always ignored the GoogleService-Info.plist located in the project root directory, and didn't copied it in the Resources folder of the project.
I manually copied the file there, and then the app compiled and ran just fine.
In my case the problem was with the cordova copying GoogleService-Info.plist and corrupting it.
So the solution is you need to do it manually.
Just copy your GoogleService-Info.plist from your root folder then go to
platforms/ios/project-name/Resources and paste it there and then there is another Resources folder in it paste it there too.
platforms/ios/project-name/Resources/Resources
Then again try to make a build or run it in simulator and it'll be working fine.
Possibly your GoogleService-Info.plist file is corrupted.
Please redownload and replace it.
original discussion here - Firebase for Cordova
Hope this helps...
Also, when you use the below method,
FirebaseApp.configure(name:userName , options: .init(googleAppID: ConfigValues.Firebase.googleAppID, gcmSenderID: ConfigValues.Firebase.gcmSenderID))
make sure you give the proper googleAppID and gcmSenderID, to avoid the similar crash.
Please redownload GoogleService-Info.plist file from firebase and replace in your project. This solved my issue.
If you are initializing firebase like this
await Firebase.initializeApp(
name: "AppName",
options: FirebaseOptions(
apiKey: "XXXXXX_XXX3VeDOXXDXXXwR8",
authDomain: "myApp.com",
databaseURL:
"https://myapp.firebasedatabase.app",
projectId: "My_App",
storageBucket: "my-app-station.com",
messagingSenderId: "39847398285093",
appId: "1:439hiojfiojh84394f3j8j943",
measurementId: "G-4489KDJJHF94"),
);
update it to this
await Firebase.initializeApp();
No need to explicitly mention all fields as per new docs
Answer may vary for Flutter Web
Solved:
If you are having this error when using Xamarin Forms you should probably check if your initial page is properly constructed. This happens when XF fails to create your initial page and just continues running. It seems that this another case where Xamarin Forms fails to properly display the error which causes a lot of pain to a lot of users when debugging.
Platform: Xamarin Forms (iOS & Android)
Prism version: 6.2.0
Xamarin Forms version: 2.3.3.180
Visual Studio 2015
Xamarin Studio 6.1.5
Sorry, I am a newbie when it comes to developing mobile applications. Having problems after updating Xamarin Studio, Xamarin Forms, Xamarin for Visual Studio. Can't seem to find a solution for this specific problem; all answers point to changing the AppDelegate FinishedLaunching for Xamarin iOS or iOS Xcode in general.
Unhandled Exception:
Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
0 CoreFoundation 0x0000000109556d4b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000113f5621e objc_exception_throw + 48
2 CoreFoundation 0x000000010955ae42 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010a13b66d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x000000010ce3091d -[UIApplication _runWithMainScene:transitionContext:completion:] + 3827
5 UIKit 0x000000010ce2d26d -[UIApplication workspaceDidEndTransaction:] + 188
6 FrontBoardServices 0x0000000116c7f6cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
7 FrontBoardServices 0x0000000116c7f544 -[FBSSerialQueue _performNext] + 189
8 FrontBoardServices 0x0000000116c7f8cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
9 CoreFoundation 0x00000001094fb761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10 CoreFoundation 0x00000001094e098c __CFRunLoopDoSources0 + 556
11 CoreFoundation 0x00000001094dfe76 __CFRunLoopRun + 918
12 CoreFoundation 0x00000001094df884 CFRunLoopRunSpecific + 420
13 UIKit 0x000000010ce2baea -[UIApplication _run] + 434
14 UIKit 0x000000010ce31c68 UIApplicationMain + 159
15 ??? 0x000000012c49543c 0x0 + 5037970492
16 ??? 0x000000012c4950ad 0x0 + 5037969581
It could be the following issues :
You forgot to register your View for navigation
You forgot to register a type with the DI container
You have a Null Reference or other Exception being thrown in your View or ViewModel. Note that the Exception could be thrown due to a custom control or other extension methods you are using in your View.
There is an error with .xaml - try commenting out a section of the code
Make sure you actually have a root page in your app.xaml.cs NavigationService.NavigateAsync("/HomePage");
This function might help you find the real reason why its failing if it's failing in App.xaml.cs
protected override async void OnInitialized()
{
try
{
TaskScheduler.UnobservedTaskException += (sender, e) => {
Logger.Log(e.Exception.ToString(), Category.Exception, Priority.High);
};
await NavigationService.NavigateAsync("HomePage");
}
catch(Exception e)
{
Logger.Log(e.ToString(), Category.Exception, Priority.High);
}
}
If you are having this error when using Xamarin Forms you should probably check if your initial page is properly constructed. This happens when XF fails to create your initial page and just continues running.
It seems that this another case where Xamarin Forms fails to properly display the error which causes a lot of pain to a lot of users when debugging.
I originally downloaded the FBSDK's version 4.10 and integrated them into my application by placing them in the frameworks folder. Realizing that these would not get updated over time, I removed them completely and tried to add them as pods to my project. The pods installed successfully, I have imported them correctly in my bridging header file, and there were no other issues. The pods update installed version 4.11 which has caused me some headache.
I am using the FBSDKLoginKit to log a user into their account and retrieve information from that. I am able to get back a dictionary with the users information just fine. I then pass this information to the next ViewController with a segue. At any point after this, if I press the home button on my iPhone or simulator, the app will crash. The error I get is
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]:
attempt to insert nil object from objects[3]'
This exception also occurs if I let the user log in through facebook, segue to the new view controller, unwind to the previous view controller, and then attempt to log in again. I have attempted to log the user out once retrieving their pertinent information on the second screen, but the error still persists.
I have seen a similar question asked where the "solution" was that the FBSDKLoginKit writes the retrieved dictionary to a variable and if the dictionary it has retrieved back has nil values, it throws this error.
Is there anything I can do to catch this before it happens? Has anyone found a work around?
Here is my output from the simulator when I press home:
*** First throw call stack:
(
0 CoreFoundation 0x0000000106f03d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010643edeb objc_exception_throw + 48
2 CoreFoundation 0x0000000106e0023e -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
3 CoreFoundation 0x0000000106e125bb +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
4 APPNAME 0x0000000101607a1e -[FBSDKTimeSpentData instanceSuspend] + 622
5 APPNAME 0x000000010160766b +[FBSDKTimeSpentData suspend] + 59
6 APPNAME 0x00000001015b5986 -[FBSDKAppEvents applicationMovingFromActiveStateOrTerminating] + 262
7 CoreFoundation 0x0000000106ecdc8c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
8 CoreFoundation 0x0000000106ecd9cb _CFXRegistrationPost + 427
9 CoreFoundation 0x0000000106ecd732 ___CFXNotificationPost_block_invoke + 50
10 CoreFoundation 0x0000000106f161e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
11 CoreFoundation 0x0000000106dc5679 _CFXNotificationPost + 633
12 Foundation 0x000000010372ccd9 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
13 UIKit 0x0000000104a685ad -[UIApplication _deactivateForReason:notify:] + 629
14 UIKit 0x0000000104a6f1f1 __61-[UIApplication _sceneSettingsPreLifecycleEventDiffInspector]_block_invoke + 104
15 FrontBoardServices 0x0000000108f88d6c __52-[FBSSettingsDiffInspector inspectDiff:withContext:]_block_invoke27 + 213
16 Foundation 0x000000010377d5bb __NSIndexSetEnumerate + 1016
17 BaseBoard 0x000000010901ba8c -[BSSettingsDiff inspectChangesWithBlock:] + 116
18 FrontBoardServices 0x0000000108f83e4a -[FBSSettingsDiff inspectOtherChangesWithBlock:] + 92
19 FrontBoardServices 0x0000000108f88b2f -[FBSSettingsDiffInspector inspectDiff:withContext:] + 317
20 UIKit 0x0000000104a70880 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 127
21 UIKit 0x0000000104a7052d -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 843
22 FrontBoardServices 0x0000000108f978c8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
23 FrontBoardServices 0x0000000108f97741 -[FBSSerialQueue _performNext] + 178
24 FrontBoardServices 0x0000000108f97aca -[FBSSerialQueue _performNextFromRunLoopSource] + 45
25 CoreFoundation 0x0000000106e29301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
26 CoreFoundation 0x0000000106e1f22c __CFRunLoopDoSources0 + 556
27 CoreFoundation 0x0000000106e1e6e3 __CFRunLoopRun + 867
28 CoreFoundation 0x0000000106e1e0f8 CFRunLoopRunSpecific + 488
29 GraphicsServices 0x0000000108ae7ad2 GSEventRunModal + 161
30 UIKit 0x0000000104a72f09 UIApplicationMain + 171
31 APPNAME 0x00000001013a26d2 main + 114
32 libdyld.dylib 0x0000000107b0d92d start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Running my code step by step I find that the error occurs during the method:
fbLoginManager.logInWithReadPermissions(permissionsNeeded, fromViewController: self) { (result, error) -> Void in
//crashes before it enters this block
//my code here
}
It crashes before I can even check the error value. I will attempt to check the values by stepping into the fbsdk methods and update
As soon as I press OK on this screen for the second time it crashes. How can I debug this? The action isn't in my app, its in the browser so I'm not sure where to go from here..
I have came across this issues recently, and i solved it by adding this piece of code in Appdelegate.m.
- (void)applicationDidBecomeActive:(UIApplication *)application {
[FBSDKAppEvents activateApp];
}
For Swift 3 version:
func applicationDidBecomeActive(_ application: UIApplication) {
FBSDKAppEvents.activateApp()
}
Update to 4.12, it fixes the issue according to their release notes:
https://developers.facebook.com/docs/ios/change-log-4.x/
The part that says:
Fixed
Fixed cases where AppEvents could crash because of missing session id.
Fixed bug in some cases where access token expiration date was the refresh date.
Although this is not necessarily a comprehensive solution, I have exhausted my debugging methods. I have removed the FBSDK's from my podfile, run pod update to remove them from the project, and reinstalled the version 4.10 FBSDK's in my frameworks folder. I will update this question after trying again when facebook releases an updated version of the FBSDK's.
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
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.
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.
Run in the command line:
cordova platform remove ios
cordova platform add ios
You can fix this issue by adding config.xml to Targets>Build Phases>Copy Bundle Resources
[Xcode V.7.0 Beta 6, OSX El Capitan, iOS9]
I'm trying to add the Twitter login using the latest version of the Parse SDK. I've tried several ways of integrating the Twitter Login with Parse but its not working. I've added my consumerkey/secret and it says that I need to initialize PFTwitterUtils which I have done.
You must call PFTwitterUtils initializeWithConsumerKey:consumerSecret: to use PFTwitterUtils" I posted the full error below as well as my github repository.
At the moment I didn't add the ParseTwitterUtils framework because it didn't say i needed to in the QuickStart guide on Parse.com. However, when I add the module I get a linker error. When i take it out, i get the error below.
Steps I took:
At first, I was having an issue with the PFTwitterUtils module not appearing or being recognized. I built the project adding the frameworks in this link: https://www.parse.com/apps/quickstart?app_id=discounts--6#parse_data/mobile/ios/swift/existing and using the SDK here: https://www.parse.com/apps/quickstart?app_id=fblogin--81#parse_data/mobile/ios/swift/existing
(similar problem to this link: No such module 'Parse' following Parse iOS Swift Quickstart guide)
I posted the issue on github, thinking it's a bug on their end:
https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/407
I was advised to check the Framework Search Path to see if the module lives inside the folder the search path is directing to. It looked good, but it still didn't work so I also tried adding another path to the ParseSDK and that also didn't work.
I then took a Parse-Starter-project from another source where the PFTwitterUtils worked (my github repository is below with the new frameworks) but then I get the error I mentioned below. I'm assuming this is the better way of going about it because now the PFTwitterUtils is recognized within Xcode but not when building the project. I also checked the callback URL when making an app on twitter. I found a stack overflow question that had a problem with the callback URL. I edited that as well and it still doesn't work.
Here is the error I'm getting:
2015-10-14 13:13:18.374 ParseStarterProject[3757:390022] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must call PFTwitterUtils initializeWithConsumerKey:consumerSecret: to use PFTwitterUtils.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f9849b5 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111927deb objc_exception_throw + 48
2 CoreFoundation 0x000000010f9848ed +[NSException raise:format:] + 205
3 ParseStarterProject 0x000000010eddcd7e +[PFTwitterUtils logInInBackground] + 31
4 ParseStarterProject 0x000000010eddce30 +[PFTwitterUtils logInWithBlock:] + 48
5 ParseStarterProject 0x000000010edca6b1 _TFC19ParseStarterProject14ViewController11viewDidLoadfS0_FT_T_ + 417
6 ParseStarterProject 0x000000010edca8c2 _TToFC19ParseStarterProject14ViewController11viewDidLoadfS0_FT_T_ + 34
7 UIKit 0x00000001106cbd05 -[UIViewController loadViewIfRequired] + 877
8 UIKit 0x00000001106cc054 -[UIViewController view] + 27
9 UIKit 0x00000001105ab77c -[UIWindow addRootViewControllerViewIfPossible] + 61
10 UIKit 0x00000001105abe79 -[UIWindow _setHidden:forced:] + 302
11 UIKit 0x00000001105bd6dc -[UIWindow makeKeyAndVisible] + 43
12 UIKit 0x000000011053dd13 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4003
13 UIKit 0x000000011054413d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755
14 UIKit 0x0000000110541390 -[UIApplication workspaceDidEndTransaction:] + 188
15 FrontBoardServices 0x00000001193b57ac -[FBSSerialQueue _performNext] + 192
16 FrontBoardServices 0x00000001193b5b1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45
17 CoreFoundation 0x000000010f8b0b21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x000000010f8a6a4c __CFRunLoopDoSources0 + 556
19 CoreFoundation 0x000000010f8a5f03 __CFRunLoopRun + 867
20 CoreFoundation 0x000000010f8a5918 CFRunLoopRunSpecific + 488
21 UIKit 0x0000000110540d2d -[UIApplication _run] + 402
22 UIKit 0x000000011054599e UIApplicationMain + 171
23 ParseStarterProject 0x000000010edcce6d main + 109
24 libdyld.dylib 0x0000000116bed92d start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
//
In the repository the ParseTwitterUtils.framework module isn't there. But once I import it I get a linker error.
Could it be that i'm missing a Framework Search Path? When i add the Framework Search Path where the frameworks live, it doesn't change anything. Any ideas of how to add the TwitterSDK with Parse with the current SDKs I'm using?
Here's the link to my repository. https://github.com/rinyfo4/ParseStarterProject-2/tree/c512acb4360d45927f0cc5b34505d3caacae728c
Any help means a lot. Thank you in advance.
Please let me know if I can provide more information.
I solved it. As i mentioned, I went to github and was helped.
This is the answer to what was going on:
According to this guide, to enable authentication with Twitter - you need to call PFTwitterUtils.initializeWithConsumerKey:consumerSecret:
The exception is being thrown about the fact that you simply didn't initialize the twitter utils, so there is no need to unlink/remove ParseTwitterUtils from Cocoapods.
pod 'ParseTwitterUtils' and ParseTwitterUtils.framework are mutually exclusive, as they are absolutely the same thing, with the only difference on how you install them.
Here is the solution: I needed to edit my AppDelegate didFinishLaunchingWithOptions method to reflect the following:
`Parse.enableLocalDatastore()
Parse.setApplicationId("...",
clientKey: "...")
PFTwitterUtils.initializeWithConsumerKey("...", consumerSecret:"...")`
Hope this helps whoever has this problem in the future.