2017-11-10 3 views
0

TwitterとFirebaseをiOS版の私のアプリケーションに統合しています。iOS Swift 4 - Twitterのログインボタンが何もしない - スタックトレースなしでスレッド1のSigabrtを返します

私は現在、Twitterのログインボタンをセットアップすることが可能ですが、私はそれをクリックすると、私はエラーを取得する:ここで

libc++abi.dylib: terminating with uncaught exception of type NSException 

は私のアプリのデリゲートです:

class AppDelegate: UIResponder, UIApplicationDelegate{ 

var window: UIWindow? 


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
    FirebaseApp.configure() 
    Twitter.sharedInstance().start(withConsumerKey:" r*******R", consumerSecret:"6*********m") 




    // Override point for customization after application launch. 
    return true 
} 
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { 
    print("yo") 
    return Twitter.sharedInstance().application(app, open: url, options: options) 
} 

そして、ここは私ですViewController:

import UIKit 
import Firebase 
import FirebaseAuth 
import TwitterKit 

class LoginController: UIViewController { 

override func viewDidLoad() { 
    super.viewDidLoad() 
    let logInButton = TWTRLogInButton(logInCompletion: { session, error in 
     if (session != nil) { 
      let authToken = session?.authToken 
      let authTokenSecret = session?.authTokenSecret 
      let credential = TwitterAuthProvider.credential(withToken: session!.authToken, secret: session!.authTokenSecret) 
      print("check1") 

      Auth.auth().signIn(with: credential, completion: { (user, error) in 
       if error != nil { 
        print("not signed in") 
        return 
       } 
      }) 
     } else { 
      print("check2") 
      print("error: \(error?.localizedDescription)"); 
     } 
    }) 
    logInButton.center = self.view.center 
    self.view.addSubview(logInButton) 

    } 

    // Do any additional setup after loading the view. 
} 

のplist:

<key>CFBundleURLTypes</key> 
    <array> 
     <dict> 
      <key>CFBundleURLSchemes</key> 
      <array> 
      <string>twitterkit-r************R </string> 
      </array> 
     </dict> 
    </array> 
    <key>LSApplicationQueriesSchemes</key> 
    <array> 
     <string>twitter</string> 
     <string>twitterauth</string> 
    </array> 
    <key>CFBundleDevelopmentRegion</key> 
    <string>$(DEVELOPMENT_LANGUAGE)</string> 
    <key>CFBundleExecutable</key> 
    <string>$(EXECUTABLE_NAME)</string> 
    <key>CFBundleIdentifier</key> 

https://imgur.com/a/LmJSP

私はViewControllerを持つ余分なコンセントをチェックしかしのViewControllerが、私はプログラム的に

任意の洞察力をいただければ幸い追加する必要がありますのみ、このログインボタンであるとして、いずれかを見つけることができませんでした!ありがとう-T

+0

"NSException型のキャッチされていない例外で終了"エラーメッセージにはそれ以上のことが書かれています。全部を与えてください。 – matt

+0

@mattは応答に感謝します。私はそれがもっと言ったと思う。私はすべての出力に私のコンソールを設定してあり、それはすべて私に与えます。 – TJBlack31

+0

OK。あなたは検索しようとしましたか?あなたのTwitterのログインボタンがクラッシュしたときに何をすべきかについてたくさんの良い提案があります。 – matt

答えて

0

新しいプロジェクトを最初から開始することで問題を解決できました。

奇妙なバグ

関連する問題