could you assist in this issue which faced when i was trying to implement "google_mobile_ads" shown after debugging my flutter app since the app had been built succesfully but the connection had lost and there was no issue in flutter doctor
E/AndroidRuntime(12485): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.initialization.OnInitializationCompleteListener" on path: DexPathList[[zip file "/data/app/~~NSY8q-IBctGxJYGXJzXLcA==/com.kids_learning_A_E-0Pc0rDeeHmisujXxSpOMaQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~NSY8q-IBctGxJYGXJzXLcA==/com.kids_learning_A_E-0Pc0rDeeHmisujXxSpOMaQ==/lib/arm64, /data/app/~~NSY8q-IBctGxJYGXJzXLcA==/com.kids_learning_A_E-0Pc0rDeeHmisujXxSpOMaQ==/base.apk!/lib/arm64-v8a, /system/lib64]] E/AndroidRuntime(12485): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207) E/AndroidRuntime(12485): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/AndroidRuntime(12485): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/AndroidRuntime(12485): ... 21 more I/Process (12485): Sending signal. PID: 12485 SIG: 9 Error handling 'checkPlatformOverride' custom request: method not available: ext.flutter.platformOverride Error handling 'checkBrightnessOverride' custom request: method not available: ext.flutter.brightnessOverride Error handling 'serviceExtension' custom request: method not available: ext.flutter.inspector.setPubRootDirectories Error handling 'checkIsWidgetCreationTracked' custom request: Bad state: No element Lost connection to device. Exited (sigterm)
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.10240], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.57.0)
[√] Connected device (2 available)
• No issues found!
It's happend when adding the below code to intiate and implement google_mobile_ads to my flutter app
void main() {
WidgetsFlutterBinding.ensureInitialized();
MobileAds.instance.initialize();
runApp(MyApp());
}
pubspec.yaml dependencies
dependencies:
flutter:
sdk: flutter
draggable_widget: ^1.1.1
services: ^0.0.1
audioplayers: ^0.18.3
flutter_staggered_animations: ^1.0.0
google_mobile_ads: ^0.11.0