Reputation: 1050
I'm experiencing this error when building my Flutter app on iOS (it works fine on Android):
MissingPluginException (MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core))
I've searched and have seen this error in several places on this forum, but the solutions are all specific to Android, not iOS. I'm at a loss.
Here is my pubspec.yaml:
dependencies:
flutter:
sdk: flutter
firebase_core: ^1.10.0
firebase_database: ^9.0.4
firebase_analytics: ^9.0.4
cloud_firestore: ^3.1.1
flutter_gallery_assets: ^1.0.2
firebase_storage: ^10.2.0
permission_handler: ^8.3.0
cupertino_icons: ^1.0.4
flutter_cupertino_localizations: ^1.0.1
http: ^0.13.4
get_it: ^7.2.0
provider: ^6.0.1
flappy_search_bar: ^1.7.2
flutter_form_builder: ^7.0.0
image_picker: ^0.8.4+4
camera: ^0.9.4+5
path_provider: ^2.0.7
path:
dev_dependencies:
flutter_test:
sdk: flutter
grinder: ^0.8.4
I've run flutter doctor
, flutter clean
, and flutter pub get
. I've removed and performed a fresh install of the app. I updated Firebase to the latest version.
Here's where I'm calling Firebase and where the error pops up:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MaterialApp(
title: "Using Tabs",
home: MyHome()));
}
For kicks, I implemented this solution in build.gradle as well, though it appears to be Android-specific, not iOS:
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
}
}
If anyone has any thoughts, it's much appreciated. Thanks!
Upvotes: 4
Views: 382
Reputation: 4816
Did you correctly register the GeneratedPluginRegistrant in your AppDelegate ?
Since Firebase is using some native platform calls, this line is required.
import UIKit
import Flutter
import Firebase
import FlutterPluginRegistrant
@UIApplicationMain
class AppDelegate: FlutterAppDelegate {
var flutterEngine : FlutterEngine?
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Instantiate Flutter engine
self.flutterEngine = FlutterEngine(name: "fullScreenEngineId")
self.flutterEngine?.run()
GeneratedPluginRegistrant.register(with: self.flutterEngine!)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Upvotes: 1