在 iOS 上添加 firebase dynamics link flutter package 后应用程序在启动时关闭
app close at the launch after add firebase dynamics link flutter package on iOS
我尝试为我的 flutter 应用添加动态 link
我遵循套餐中的所有步骤
https://pub.dev/packages/firebase_dynamic_links
- 我在 firebase 中创建动态链接
- 我为 xcode
添加功能
- 我使用我的应用程序包 ID 创建 URL 类型
- 我将 FirebaseDynamicLinksCustomDomains 添加到 inflo.plist
- 我将包添加到 pubspec.yaml 并将示例代码添加到测试
此后当我启动调试模式时,应用程序在启动后直接崩溃
这里是xcode日志
Exception NSException * "`[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/." 0x0000000283edf8a0
name __NSCFConstantString * "com.firebase.core" 0x0000000103378780
reason __NSCFString * "`[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/." 0x0000000280b69fb0
userInfo void * NULL 0x0000000000000000
reserved __NSDictionaryM * 2 key/value pairs 0x00000002830545c0
2021-02-17 11:01:35.108411+0100 Runner[15847:4634605] Metal API Validation Enabled
2021-02-17 11:01:35.583061+0100 Runner[15847:4634605] Configuring the default Firebase app...
2021-02-17 11:01:35.583239+0100 Runner[15847:4634720] 7.3.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2021-02-17 11:01:35.583305+0100 Runner[15847:4634720] 7.3.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2021-02-17 11:01:35.585109+0100 Runner[15847:4634605] *** 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/.'
*** First throw call stack:
(0x19c5b896c 0x19c2d1028 0x19c4a814c 0x103367518 0x102f2b8c4 0x102f2b69c 0x102f25fd4 0x102f266b4 0x102f26a10 0x1a06afc18 0x1a06b1a14 0x1a06b7340 0x19fe4fbec 0x1a0301518 0x19fe50724 0x19fe50154 0x19fe50540 0x19fe4fdc4 0x19fe54544 0x1a031b39c 0x1a022d7bc 0x1a031b354 0x19fe5425c 0x1a031b23c 0x19fe540b8 0x19fcbc434 0x19fcbaef8 0x19fcbc164 0x1a06b5730 0x1a024f6bc 0x1a17ade10 0x1a17d4aa0 0x1a17b8ef4 0x1a17d4734 0x1057a727c 0x1057aa9a4 0x1a17fb254 0x1a17faf00 0x1a17fb46c 0x19c534108 0x19c53405c 0x19c5337c8 0x19c52e694 0x19c52df40 0x1a67be534 0x1a06b9580 0x102f26c04 0x19c3ace18)
libc++abi.dylib: terminating with uncaught exception of type NSException
谢谢
您的 Runner > AppDelegate.swift
文件应该如下所示
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
我尝试为我的 flutter 应用添加动态 link
我遵循套餐中的所有步骤
https://pub.dev/packages/firebase_dynamic_links
- 我在 firebase 中创建动态链接
- 我为 xcode 添加功能
- 我使用我的应用程序包 ID 创建 URL 类型
- 我将 FirebaseDynamicLinksCustomDomains 添加到 inflo.plist
- 我将包添加到 pubspec.yaml 并将示例代码添加到测试
此后当我启动调试模式时,应用程序在启动后直接崩溃
这里是xcode日志
Exception NSException * "`[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/." 0x0000000283edf8a0
name __NSCFConstantString * "com.firebase.core" 0x0000000103378780
reason __NSCFString * "`[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/." 0x0000000280b69fb0
userInfo void * NULL 0x0000000000000000
reserved __NSDictionaryM * 2 key/value pairs 0x00000002830545c0
2021-02-17 11:01:35.108411+0100 Runner[15847:4634605] Metal API Validation Enabled
2021-02-17 11:01:35.583061+0100 Runner[15847:4634605] Configuring the default Firebase app...
2021-02-17 11:01:35.583239+0100 Runner[15847:4634720] 7.3.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
2021-02-17 11:01:35.583305+0100 Runner[15847:4634720] 7.3.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2021-02-17 11:01:35.585109+0100 Runner[15847:4634605] *** 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/.'
*** First throw call stack:
(0x19c5b896c 0x19c2d1028 0x19c4a814c 0x103367518 0x102f2b8c4 0x102f2b69c 0x102f25fd4 0x102f266b4 0x102f26a10 0x1a06afc18 0x1a06b1a14 0x1a06b7340 0x19fe4fbec 0x1a0301518 0x19fe50724 0x19fe50154 0x19fe50540 0x19fe4fdc4 0x19fe54544 0x1a031b39c 0x1a022d7bc 0x1a031b354 0x19fe5425c 0x1a031b23c 0x19fe540b8 0x19fcbc434 0x19fcbaef8 0x19fcbc164 0x1a06b5730 0x1a024f6bc 0x1a17ade10 0x1a17d4aa0 0x1a17b8ef4 0x1a17d4734 0x1057a727c 0x1057aa9a4 0x1a17fb254 0x1a17faf00 0x1a17fb46c 0x19c534108 0x19c53405c 0x19c5337c8 0x19c52e694 0x19c52df40 0x1a67be534 0x1a06b9580 0x102f26c04 0x19c3ace18)
libc++abi.dylib: terminating with uncaught exception of type NSException
谢谢
您的 Runner > AppDelegate.swift
文件应该如下所示
import UIKit
import Flutter
import Firebase
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
if FirebaseApp.app() == nil {
FirebaseApp.configure()
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}