flutterfire_cli
flutterfire_cli copied to clipboard
Error on IOS when configure using client
Hello, after configured a new empty project using the command "flutterfire configure". And ran the app I get this error:
`Running Xcode build...
└─Compiling, linking and signing... 8,3s
Xcode build done. 18,3s
(lldb) 2021-12-22 20:46:57.821486-0300 Runner[8894:2915059] Warning: Unable to create restoration in progress marker file
Configuring the default Firebase app...
8.9.0 - [Firebase/Core][I-COR000012] Could not locate configuration file: 'GoogleService-Info.plist'.
8.9.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI). Read more: https://goo.gl/ctyzm8.
8.9.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI). Read more: https://goo.gl/ctyzm8.
8.9.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
*** Terminating app due to uncaught exception 'com.firebase.core', reason: '`FirebaseApp.configure()` could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'
*** First throw call stack:
(0x1822b204c 0x19a926f54 0x182309180 0x104b3593c 0x103622670 0x103622568 0x102b9e518 0x102b9eb9c 0x102b9ee48 0x1849e8044 0x184bcfb38 0x184bb84a4 0x184a15e44 0x18486e62c 0x184999b7c 0x184aba380 0x184cfaf8c 0x184c86710 0x18486f430 0x18492f350 0x184871340 0x18495bdf4 0x184de3260 0x18489fc60 0x1848e3524 0x184a1ad70 0x18495a0b4 0x193da9e20 0x193dcfcdc 0x193d8a6b4 0x193d8bcf4 0x181f24660 0x181f28118 0x193d8bf94 0x193d8b3d4 0x193d8f9e4 0x1822d4020 0x1822e4ce0 0x18221efe8 0x1822247f4 0x1822383b8 0x19dbc838c 0x184bd86a8 0x1849577f4 0x102b9efbc 0x104bada24)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00000001b85f4964 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
-> 0x1b85f4964 <+8>: b.lo 0x1b85f4984 ; <+40>
0x1b85f4968 <+12>: pacibsp
0x1b85f496c <+16>: stp x29, x30, [sp, #-0x10]!
0x1b85f4970 <+20>: mov x29, sp
Target 0: (Runner) stopped.
Installing and launching...`
My "main.dart" file:
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:prueba/firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
FirebaseApp app = await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
print('Initialized default app $app');
runApp(const MyApp());
}
And the "firebase_obtions.dart" file exist at the same level of my "main.dart" file.
In the documentation don't mention I have to add 'GoogleService-Info.plist' file manually.
Check your AppDelegate.swift file and remove "FirebaseApp.configure()".
If you use a new init way then set options in your main.dart file only. Seems that you remove plist file but left FirebaseApp.configure() in your AppDelegate.swift file. In my case, this was the same problem.
Check your AppDelegate.swift file and remove "FirebaseApp.configure()".
If you use a new init way then set options in your main.dart file only. Seems that you remove plist file but left FirebaseApp.configure() in your AppDelegate.swift file. In my case, this was the same problem.
The AppDelegate.swift don't have the method:
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
I have a similar issue
@Rart3001 did you make it work somehow?
I force to use the 8.10.0 version in the Podfile
$FirebaseSDKVersion='8.10.0'
Do we have any permanent solution for this?
I have the same probrem.
You don't have to add GoogleService-Info.plist manually.
Activate the latest FF CLI by running dart pub global activate flutterfire_cli . The service files are now written for android & iOS using FF CLI. We're thinking of removing the Dart initialization code generated for android and iOS to clear up the confusion.