bdlukaa / native_admob_flutter

Easy-to-make native ads in flutter using AdMOB SDK.
https://pub.dev/packages/native_admob_flutter
BSD 3-Clause "New" or "Revised" License
80 stars 56 forks source link

Initializing failed #136

Open wmla419 opened 2 years ago

wmla419 commented 2 years ago

My banner ads can be successfully displayed, but when I use this package to display native ads, it says my mobile sdk has not been initialized. I have already called await MobileAds.instance.initialize(); in the main method, and the banner ads can be loaded, how come my sdk has not been initialized?

The following is the error returned

E[/flutter]() ( 5851): [ERROR:flutter[/lib/ui/ui_dart_state.cc]()(209)] Unhandled Exception: 'package:native_admob_flutter[/src/utils.dart]()': Failed assertion: line 30 pos 5: 'MobileAds.isInitialized': The Mobile Ads SDK must be initialized before any ads can be loaded package:native_admob_flutter/src/utils.dart:30 E[/flutter]() ( 5851): #0 _AssertionError._doThrowNew (dart:core-patch[/errors_patch.dart:51:61]())