iOS Twitter Auth/ logInbutton creates error when clicked: libc++abi.dylib: terminating with uncaught exception of type NSException




I’m currently porting an Android app over to iOS. I am using the login button, which has to be added programmatically (can’t use storyboard). When ever i click it, I get a Thread 1 SIGABRT error reflecting back to my AppDelegate file.

I’ve been racking my brain over why this is happening. I installed TwitterKit using cocoa pods and manually added the TwitterKitResources.bundle file to “Copy Bundle Resources”. From what I’ve researched, this should be due to a unaccounted for outlet in storyboard, but since I’m adding this programmatically, I can’t really check that. None of the code attached to my loginButton executes when clicked

class AppDelegate: UIResponder, UIApplicationDelegate{

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    Twitter.sharedInstance().start(withConsumerKey:" r*********R", consumerSecret:"6*************m")
    // Override point for customization after application launch.
    return true

and for the LoginViewController

 import UIKit
import Firebase
 import FirebaseAuth
import TwitterKit
import SafariServices

class LoginController: UIViewController {

override func viewDidLoad() {
    let logInButton = TWTRLogInButton(logInCompletion: { session, error in
        if (session != nil) {
            print("signed in as \(String(describing: session?.userName))");
        } else {
            print("error: \(String(describing: error?.localizedDescription))");
    }) =
    // Do any additional setup after loading the view.

Any insights would be greatly appreciated!



I was able to resolve issue by creating a new xcode project