Back

I`m trying to display BannerAd in the home page whenever I try to run the app throwing exception

  • 1
  • Flutter
Drake
23 Feb, 2023, 05:25

And what's the rest of this code?

TL;DR
User is trying to display a BannerAd on the home page of their app but it's throwing an exception. They have not called `MobileAds.instance.initialize()` on app start, which might be causing the issue. The user is advised to implement it. They are also reminded that this support thread is for Appwrite, and they might find more help in a flutter-specific discord server. The user provides some code snippets and confirms that the exception occurs when the DisplayBanner widget is uncommented. The conversation continues with discussing the exception and the code being run on an emulator. It is then mentioned that the package is only supported on mobile devices and
MatrexWaed
23 Feb, 2023, 05:28
MatrexWaed
23 Feb, 2023, 05:29

the rest of this Code is just navigation from page to another

MatrexWaed
23 Feb, 2023, 05:31

if I comment the DisplayBanner(),

MatrexWaed
23 Feb, 2023, 05:31

The code run nomral

Drake
23 Feb, 2023, 07:00

Uhm...are you running a windows desktop app?

Drake
23 Feb, 2023, 07:01

The package is only supported on mobile devices

MatrexWaed
24 Feb, 2023, 03:18

I`m running the app on emulator

Drake
24 Feb, 2023, 03:21

Where's the exception?

MatrexWaed
24 Feb, 2023, 03:22

Cuz I commented DisplayBanner widget so no exception

Drake
24 Feb, 2023, 03:23

Would you please share the rest of the code from this file?

Drake
24 Feb, 2023, 03:23

So you're still getting the same exception running on an emulator?

MatrexWaed
24 Feb, 2023, 03:23

yes

MatrexWaed
24 Feb, 2023, 03:23
MatrexWaed
24 Feb, 2023, 03:24

This is the BannerAd code

MatrexWaed
24 Feb, 2023, 03:24

if there`s anymistake should be here

Drake
24 Feb, 2023, 03:25

Would you please share a screenshot of the exception?

Drake
24 Feb, 2023, 03:25

Uhhh you can't just throw unimplemented...

MatrexWaed
24 Feb, 2023, 03:25

its by default

Drake
24 Feb, 2023, 03:26

You need.to implement it

MatrexWaed
24 Feb, 2023, 03:26

are u free for a few mins ?

Drake
24 Feb, 2023, 03:26

Sorry I am not.

Also, FYI, this is a discord server for Appwrite (https://appwrite.io/). For general flutter help, you might find more help in a flutter specific discord server.

MatrexWaed
24 Feb, 2023, 03:26

okay thx

Drake
24 Feb, 2023, 03:33

Also, did you call MobileAds.instance.initialize() on app start?

MatrexWaed
24 Feb, 2023, 03:40

Yes I did

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more