swift初心者です。
このたび、swiftを使ってサインアップ画面を作ってみたのですが、AppDelegate.swiftの
class AppDelegate: UIResponder, UIApplicationDelegate
の行で以下のようなエラー文が発生していました。
outlet,actionの接続は問題なし、再起動も試しました。
Thread 1:signal SIGABRT
原因は何でしょうか?
下にAppDelegate.swiftとviewController.swiftのソースコードを載せておきます。
AppDelegate
1import UIKit 2import Firebase 3 4@UIApplicationMain 5class AppDelegate: UIResponder, UIApplicationDelegate { 6 7 var window: UIWindow? 8 9 10 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 11 FirebaseApp.configure() 12 // Override point for customization after application launch. 13 return true 14 } 15 16 func applicationWillResignActive(_ application: UIApplication) { 17 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 18 // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 19 } 20 21 func applicationDidEnterBackground(_ application: UIApplication) { 22 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 23 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 24 } 25 26 func applicationWillEnterForeground(_ application: UIApplication) { 27 // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 28 } 29 30 func applicationDidBecomeActive(_ application: UIApplication) { 31 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 32 } 33 34 func applicationWillTerminate(_ application: UIApplication) { 35 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 36 } 37 38 39} 40 41
viewController
1import UIKit 2import Firebase 3import FirebaseAuth 4 5class ViewController: UIViewController { 6 7 @IBOutlet weak var email: UITextField! 8 9 @IBOutlet weak var password: UITextField! 10 11 override func viewDidLoad() { 12 super.viewDidLoad() 13 // Do any additional setup after loading the view. 14 } 15 16 @IBAction func signup(_ sender: Any) { 17 18 Auth.auth().createUser(withEmail: email.text!, password: password.text!) { (user, error) in 19 if error != nil { 20 print("登録できませんでした") 21 } 22 23 else { 24 print("登録できました") 25 } 26 } 27 } 28} 29 30
console
12019-06-11 15:37:50.958360+0900 car pool[3436:233604] - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist 22019-06-11 15:37:51.050371+0900 car pool[3436:233604] 6.2.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'. 32019-06-11 15:37:51.052017+0900 car pool[3436:233604] 6.2.0 - [Firebase/Core][I-COR000005] No app has been configured yet. 42019-06-11 15:37:51.112385+0900 car pool[3436:233527] *** Terminating app due to uncaught exception 'com.firebase.core', reason: '`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.' 5*** First throw call stack: 6(0x188bb927c 0x187d939f8 0x188ac34b0 0x1028b1de0 0x102856e70 0x102856f68 0x1b54eae30 0x1b54ec594 0x1b54f1d20 0x1b4db52dc 0x1b4dbd874 0x1b4db4f60 0x1b4db5850 0x1b4db3b9c 0x1b4db3864 0x1b4db83a4 0x1b4db9188 0x1b4db825c 0x1b4dbcf5c 0x1b54f0328 0x1b50ecba8 0x18b5349fc 0x18b53e40c 0x18b53dc14 0x1054fcc74 0x105500840 0x18b56f040 0x18b56ecdc 0x18b56f294 0x188b4b018 0x188b4af98 0x188b4a880 0x188b457bc 0x188b450b0 0x18ad4579c 0x1b54f3978 0x10285788c 0x18860a8e0) 7libc++abi.dylib: terminating with uncaught exception of type NSException
回答1件
あなたの回答
tips
プレビュー