質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

解決済

2回答

1010閲覧

Firebaseの設定が終わらない

monokuro08

総合スコア12

Firebase

Firebaseは、Googleが提供するBasSサービスの一つ。リアルタイム通知可能、並びにアクセス制御ができるオブジェクトデータベース機能を備えます。さらに認証機能、アプリケーションのログ解析機能などの利用も可能です。

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

1クリップ

投稿2019/11/30 06:21

超初心者です。

前提・実現したいこと

Firebaseの設定が最後、以下の画面から進みません。
問題の図
アプリがサーバーと通信したかどうかを確認中です。場合によってはアプリのアンインストールと再インストールが必要です。

バンドルID、doodle.info、pod fileも作りましたし、初期コードなども手順に従い、追加しました。

AppDelegate.swift

swift

1import UIKit 2import CoreData 3import Firebase 4 5 6@UIApplicationMain 7class AppDelegate: UIResponder, UIApplicationDelegate { 8 9 var window: UIWindow? 10 11 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 12 FirebaseApp.configure() 13 return true 14 } 15 16 // MARK: UISceneSession Lifecycle 17 18 func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 19 // Called when a new scene session is being created. 20 // Use this method to select a configuration to create the new scene with. 21 return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 22 } 23 24 func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) { 25 // Called when the user discards a scene session. 26 // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 27 // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 28 } 29 30 // MARK: - Core Data stack 31 32 lazy var persistentContainer: NSPersistentContainer = { 33 /* 34 The persistent container for the application. This implementation 35 creates and returns a container, having loaded the store for the 36 application to it. This property is optional since there are legitimate 37 error conditions that could cause the creation of the store to fail. 38 */ 39 let container = NSPersistentContainer(name: "jfcle") 40 container.loadPersistentStores(completionHandler: { (storeDescription, error) in 41 if let error = error as NSError? { 42 // Replace this implementation with code to handle the error appropriately. 43 // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 44 45 /* 46 Typical reasons for an error here include: 47 * The parent directory does not exist, cannot be created, or disallows writing. 48 * The persistent store is not accessible, due to permissions or data protection when the device is locked. 49 * The device is out of space. 50 * The store could not be migrated to the current model version. 51 Check the error message to determine what the actual problem was. 52 */ 53 fatalError("Unresolved error (error), (error.userInfo)") 54 } 55 }) 56 return container 57 }() 58 59 // MARK: - Core Data Saving support 60 61 func saveContext () { 62 let context = persistentContainer.viewContext 63 if context.hasChanges { 64 do { 65 try context.save() 66 } catch { 67 // Replace this implementation with code to handle the error appropriately. 68 // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 69 let nserror = error as NSError 70 fatalError("Unresolved error (nserror), (nserror.userInfo)") 71 } 72 } 73 } 74 75} 76 77

Podfile

Podfile

1 Uncomment the next line to define a global platform for your project 2# platform :ios, '9.0' 3 4target 'jfcle' do 5 # Comment the next line if you don't want to use dynamic frameworks 6 use_frameworks! 7 8 # Pods for jfcle 9 # add the Firebase pod for Google Analytics 10 pod 'Firebase/Analytics' 11 # add pods for any other desired Firebase products 12 pod 'DTGradientButton' 13 pod 'Firebase/Core' 14 pod 'Firebase/Firestore' 15 pod 'Firebase/Storage' 16 pod 'Firebase/Auth' 17 pod 'FirebaseDatabase' 18 # https://firebase.google.com/docs/ios/setup#available-pods 19 20end 21

解決方法を教えていただきたいです。よろしくお願い致します。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

popai306

2019/11/30 06:24

iosアプリ起動しました?
monokuro08

2019/11/30 06:26

シミュレーターということでしょうか?
popai306

2019/11/30 06:29

実機でもいいですが
monokuro08

2019/11/30 06:35

シミュレータを初めて立ち上げました。 そしたらこのようなエラーが表示されました 、、、 + (void)configure { FIROptions *options = [FIROptions defaultOptions]; if (!options) { [NSException raise:kFirebaseCoreErrorDomain format:@"`[FIRApp configure];` (`FirebaseApp.configure()` in Swift) could not find " @"a valid GoogleService-Info.plist in your project. Please download one " @"from %@.", kPlistURL]; } 、、、 これの [NSException raise:kFirebaseCoreErrorDomainの箇所にThread 1: signal SIGABRTというエラーが表示されました、 どうづればいいのでしょうか?教えて欲しいです????‍♂️
popai306

2019/11/30 06:39 編集

まずアプリ起動しないとFirebase(サーバ)と通信しないので、アプリ起動しない限り上の⑤のステップはクリアできません。 で、次の問題ですね。 ステップ④あたりでgoogleservie-info.plistをダウンロードして自分のアプリに追加するやつがあると思いますが、それは実施しました?
monokuro08

2019/11/30 06:42 編集

5についてわかりました。本当にありがとうございます。感謝です。 はい、ちゃんとダウンロードして、Info.plistの下にgoogleservie-info.plistを入れてあります。
popai306

2019/11/30 06:44

valid GoogleService-Info.plist と明示的に出ている以上、firebaseにアプリの情報を入れるときにタイプミスしてるくらいしか考えつかないですね〜
monokuro08

2019/11/30 06:45

.xcworkspaceの方には入れました。もしかして、.xcodeprojの方にも追加しなければいけないのでしょうか?
popai306

2019/11/30 06:47

もしかしてfinderで直接ドラッグ&ドロップしました?
popai306

2019/11/30 06:52 編集

それだと.plistは認識されません。 Xcode上で左パネル(ソースコード一覧が見える画面)にドラッグ&ドロップしてください ※通常のinfo.plistと同じ位置に
monokuro08

2019/11/30 07:00

そうなんですね!解決しました! 本当にありがとうございました。 感謝です。
popai306

2019/11/30 07:03

お疲れさまでした! Firebaseはめっちゃおもしろいのでいろいろ活用してみてください! ちなみに.plistファイルに限らずその他のファイルでもXcodeを通して操作しないと正常に動かないことは多々あるので、なるべくXcodeをつかってファイル操作をしてください!
guest

回答2

0

ベストアンサー

アプリ起動(実機 or シミュレータ)しないとFirebase(サーバ)と通信しないので、
アプリ起動しない限り上の⑤のステップはクリアできません。

※「質問への追記・修正の依頼」欄にてアプリ起動後Firebaseに接続できず、こちらの問題も確認中

投稿2019/11/30 06:47

編集2019/11/30 06:51
popai306

総合スコア157

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

JunYoshida

2020/03/28 14:21

アプリを起動しても「アプリがサーバーと通信したかどうかを確認中です~」の画面から移動しません。同じ現象の方、いませんでしょうか?
Tommy2020

2020/06/22 14:07

全く同じ現象なのですが、どうやって解決されました?
guest

0

環境によって違うかもしれませんが、私も同じ状況になりましたが、実機デバッグビルドに切り替えてみたところ無事Passしました。

投稿2020/05/06 21:12

yhasegawa55

総合スコア189

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問