import io.flutter.app.FlutterApplication;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
public class MyApplication extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
GeneratedPluginRegistrant.registerWith(registry); //<--
}
}
Hi @pradeep121212
can you please provide your flutter doctor -v ?
Thank you
has this been solved?
Any solutions? Still getting this error
Solved using :
https://stackoverflow.com/questions/59446933/pluginregistry-cannot-be-converted-to-flutterengine
On Wed 22 Jan, 2020, 2:11 PM Krishnakumar CN, notifications@github.com
wrote:
Any solutions? Still getting this error
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/FirebaseExtended/flutterfire/issues/1729?email_source=notifications&email_token=ALRBEKDGR6QCGQQFG3ZY7OLQ7ABDRA5CNFSM4KA65FCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJSWFIY#issuecomment-577069731,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALRBEKAO2AP6AH3ESGHNV3DQ7ABDRANCNFSM4KA65FCA
.
I am also facing this error.
seeing the following message at Debug console
error: incompatible types: PluginRegistry cannot be converted to FlutterEngine
GeneratedPluginRegistrant.registerWith(registry);
Solution?
https://stackoverflow.com/questions/59446933/pluginregistry-cannot-be-converted-to-flutterengine
This worked for me too..
@krishnakumarcn Ive try but my app crash
Can you provide the error message?
Do all the steps mentioned in the stack overflow answer.
From changing the conten8of AndroidManifest to creating a new custom plugin registrant.
Unable to instantiate activity ComponentInfo{com.my.pack/com.my.pack.Application}: java.lang.ClassCastException:com.my.pack.Application cannot be cast to android.app.Activity
@krishnakumarcn
The error is:
Unable to instantiate activity ComponentInfo{com.my.pack/com.my.pack.Application}: java.lang.ClassCastException:com.my.pack.Application cannot be cast to android.app.Activity
original Mainactivity
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
my application.java
import io.flutter.app.FlutterApplication;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService;
public class Application extends FlutterApplication implements PluginRegistrantCallback {
@Override
public void onCreate() {
super.onCreate();
FlutterFirebaseMessagingService.setPluginRegistrant(this);
}
@Override
public void registerWith(PluginRegistry registry) {
FirebaseCloudMessagingPluginRegistrant.registerWith(registry);
}
}
@stoppiNeobiz AndroidManifest file?
I'm facing the same issue @krishnakumarcn when I applied the solution from stackoverflow my app is building successfully but not opening. because i have many other plugins used in my app such as firebase Auth, firebase database etc they all got auto registered in GeneratedPluginRegistrant
my configureFlutterEngine is
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
flutterEngine.plugins.add(DeviceInfoPlugin())
flutterEngine.plugins.add(FirebaseAnalyticsPlugin())
flutterEngine.plugins.add(FirebaseCorePlugin())
flutterEngine.plugins.add(FirebaseCrashlyticsPlugin())
flutterEngine.plugins.add(FirebaseRemoteConfigPlugin())
flutterEngine.plugins.add(FirebaseMessagingPlugin())
flutterEngine.plugins.add(PackageInfoPlugin())
flutterEngine.plugins.add(SharedPreferencesPlugin())
flutterEngine.plugins.add(UrlLauncherPlugin())
val handler = MethodCallHandler(this)
MethodChannel(flutterEngine.dartExecutor, MethodCallHandler.CHANNEL_NAME).setMethodCallHandler(handler)
}
not like yours
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
Fatal: failed to find callback
problem happnes
Hey all 👋
As part of our roadmap (#2582) we've just shipped a complete rework of the firebase_messaging plugin that aims to solve this and many other issues.
If you can, please try out the dev release (see the migration guide for upgrading and for changes) and if you have any feedback then join in the discussion here.
Given the scope of the rework I'm going to go ahead and close this issue in favor of trying out the latest plugin.
Thanks everyone.
Most helpful comment
I am also facing this error.
seeing the following message at Debug console