Suddenly this error appears in the debug console. I do not know what I did wrong.
-
1are you using agora???Vinamra Jaiswal– Vinamra Jaiswal2022-07-06 08:32:09 +00:00Commented Jul 6, 2022 at 8:32
-
No I'm not using agoraMsPoojitha– MsPoojitha2022-07-07 14:10:41 +00:00Commented Jul 7, 2022 at 14:10
-
This helped me : stackoverflow.com/a/70467105/15823478shaderone– shaderone2023-02-27 16:38:26 +00:00Commented Feb 27, 2023 at 16:38
-
I had the same problem and what worked for me was upgrading the firebase packages and installing the podfile againKorhan_34– Korhan_342025-08-29 22:34:33 +00:00Commented Aug 29 at 22:34
17 Answers
You've upgraded Flutter but not the packages. In the terminal enter
flutter pub outdated
Then upgrade the outdated packages one by one like this:
flutter pub upgrade outdated_package
After you're finished:
flutter clean
and
flutter pub get
Your problem should now be solved.
11 Comments
I spent a long time looking into this and eventually traced it to the plugin registrar being nil when setting up the plugin.
This was caused by setting my iOS app root view controller to anything other than FlutterViewController (i.e. in my case, I had a UINavigationController as the root). This will result in a failure to register all your plugins.
The app delegate assumes that the root view controller is a FlutterViewController, so if it isn't then you will need to re-direct all plugin-related function calls to your FlutterViewController from your app delegate.
You can do this by overriding these functions as follows in AppDelegate.swift:
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
var flutterViewController: FlutterViewController!
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Wherever your FlutterViewController is in your view hierarchy, you need to get a reference to it:
let navController = window!.rootViewController as! UINavigationController
self.flutterViewController = navController.children.first as! FlutterViewController
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
// Add these overrides to redirect all the FlutterAppDelegate functions to your flutterViewController:
override func registrar(forPlugin pluginKey: String) -> FlutterPluginRegistrar? {
flutterViewController.registrar(forPlugin: pluginKey)
}
override func hasPlugin(_ pluginKey: String) -> Bool {
flutterViewController.hasPlugin(pluginKey)
}
override func valuePublished(byPlugin pluginKey: String) -> NSObject? {
flutterViewController.valuePublished(byPlugin: pluginKey)
}
}
6 Comments
FlutterViewController wrong - especially in case of not having FlutterAppDelegate. So this answer gives you the correct direction. Helped me out a lot @jonathan, thanks!GeneratedPluginRegistrant.register(with: ... as the documentation said. (I was using the codes in Create a FlutterViewController with an implicit FlutterEngine section of the document so I somehow missed that PluginRegistrant thing.)FlutterViewController is inside a UINavigationController, you'll also find that SystemChrome.setPreferredOrientations() won't work either. I've just posted a workaround to that problem here (posting here as I reckon people will be looking at this answer who are likely to run into this issue!)I had the same issue and stumped on this post.
In my case I was able to detect which plugin was in fact giving the error and it turned out to be firebase_core. So, I decided to upgrade the package to the latest version which happened to be 1.21.1 in my case.
So, to solve the issue I will suggest you try changing the version of the firebase_core package you're using to the latest in the pubspec.yaml file of your project like so:
firebase_core: ^1.21.1 (replace with latest verison)
Or you can just run:
flutter pub upgrade firebase_core
This will upgrade firebase_core to the latest version.
Or you can as well put any as the version code in the pubspec.yaml file of your project like so:
firebase_core: any (upgrades firebase_core to the latest verison)
3 Comments
In my case, This line was missing in MainAcitivty.java
GeneratedPluginRegistrant.registerWith(flutterEngine);
with it's import
import io.flutter.plugins.GeneratedPluginRegistrant;
1 Comment
As of 9th July, 2025. I updated my Dart environment.
environment:
sdk: ^3.8.1
Then I also updated all firebase dependencies to the latest version.
dependencies:
firebase_analytics: ^11.5.2
firebase_app_check: ^0.3.2+9
firebase_auth: ^5.6.2
firebase_core: ^3.15.1
firebase_crashlytics: ^4.3.9
firebase_messaging: ^15.2.9
firebase_performance: ^0.10.1+9
firebase_storage: ^12.4.9
firebase_ui_firestore: ^1.7.2
dev dependencies:
firebase_auth_platform_interface: ^7.7.2
firebase_core_platform_interface: ^6.0.0
After that, I run:
flutter clean
flutter pub get
And that resolved the issue.
1 Comment
I also effected from that issue for few hours, finally I found issue that was I ran my emulator as windows (:, yeah please run with Android emulator you selected vm.
1 Comment
Try out different devices like Chrome or Android if you run into this error. Note that firebase does not run on all platforms flutter runs on.
In my case I was developing on Linux and got that PlatformException because I was launching the app as a Linux program - which is not supported by Firebase and thus raises the error even though everything is configured correctly.
Comments
Adding GeneratedPluginRegistrant.registerWith(flutterEngine); to MainActivity.kt did work for me.
import io.flutter.plugins.GeneratedPluginRegistrant
//...
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(flutterEngine);
configureChannels(flutterEngine)
}
Sousce:
https://github.com/firebase/flutterfire/issues/9113#issuecomment-1188429009
Comments
Posting on 19 March 2025.
first I would suggest to upgrade the flutter firebase packages (including firebase_core, firebase_auth) .
flutter pub outdated
flutter pub upgrade outdated_package
project > app > build.gradle [update compileSdk, minSdk ]
android {
namespace = "com.example.pixelplayapp" //your app namespace
compileSdk = 35
ndkVersion = 30
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// if youre using gradle 8.1.1-8.3.4
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.pixelplayapp"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
flutter clean
flutter pub get
flutter run. By doing so I have fixed my issue.

