-1
自分のコードでSIGABRTエラーが発生し続けるが、その理由は分かりません。 私は非常に単純なエラーを見過ごしていると感じ、私はそれを把握していないようです。IBAction Swiftでクラッシュする
UIButtonをクリックするたびに、アプリのクラッシュの問題がIBOutlet内にあるようです。
SIGABRTエラーがAppDelagate
SignInViewControllerの先頭から開始:
import UIKit
import Firebase
import GoogleSignIn
@objc(SignInViewController)
class SignInViewController: UIViewController, GIDSignInUIDelegate {
//@IBOutlet weak var signInButton: GIDSignInButton!
@IBOutlet weak var signInButton: GIDSignInButton!
// @IBOutlet weak var signInButton: GIDSignInButton!
var handle: FIRAuthStateDidChangeListenerHandle?
override func viewDidLoad() {
super.viewDidLoad()
GIDSignIn.sharedInstance().uiDelegate = self
GIDSignIn.sharedInstance().signInSilently()
handle = FIRAuth.auth()?.addStateDidChangeListener() { (auth, user) in
if user != nil {
MeasurementHelper.sendLoginEvent()
self.performSegue(withIdentifier: Constants.Segues.SignInToFp, sender: nil)
}
}
}
deinit {
if let handle = handle {
FIRAuth.auth()?.removeStateDidChangeListener(handle)
}
}
}
Applegate.swift:
import UIKit
// UserNotifications are only required for the optional FCM step
import UserNotifications
import Firebase
import GoogleSignIn
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
var window: UIWindow?
@available(iOS 9.0, *)
func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any])
-> Bool {
return self.application(application, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: "")
}
func application(_ application: UIApplication,
open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
return GIDSignIn.sharedInstance().handle(url, sourceApplication: sourceApplication, annotation: annotation)
}
func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error?) {
if let error = error {
print("Error \(error)")
return
}
guard let authentication = user.authentication else { return }
let credential = FIRGoogleAuthProvider.credential(withIDToken: authentication.idToken,
accessToken: authentication.accessToken)
FIRAuth.auth()?.signIn(with: credential) { (user, error) in
if let error = error {
print("Error \(error)")
return
}
}
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FIRApp.configure()
GIDSignIn.sharedInstance().clientID = FIRApp.defaultApp()?.options.clientID
GIDSignIn.sharedInstance().delegate = self
return true
}
}
より有用な情報を提供することはできますか?これから、情報源を見つけるのは難しいでしょう。 – aircraft
ボタンが配置されているUIButtonとView Controllerはどちらですか? –