Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The class 'FirebaseAnalytics' doesn't have an unnamed constructor

I would like to use firebase analytics but keep getting this error, I upgrade and cleaned but still has the same error. any idea how I can solve it? thanks

static FirebaseAnalytics analytics = FirebaseAnalytics(); FirebaseAnalytics is underlined

like image 218
Taoufik Avatar asked Feb 20 '26 19:02

Taoufik


1 Answers

I solve it by removing the parentheses and adding .instance.

static FirebaseAnalytics analytics = FirebaseAnalytics.instance;

see documentation. Thanks

like image 51
Taoufik Avatar answered Feb 23 '26 12:02

Taoufik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!