firebase / flutterfire

πŸ”₯ A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.68k stars 3.97k forks source link

πŸ› [admob] Admob does not return real ads when Ad unit is set to real unit id #3895

Closed mshahzaib1629 closed 3 years ago

mshahzaib1629 commented 4 years ago

Bug report

Describe the bug When using test ads, all the ads are shown perfectly. But when I use my own app id and ad units, I'm getting error: I/Ads (21375): This request is sent from a test device. I/AudioManager(21375): getMode name:com.codelab.awesomedrawingquiz W/flutter (21375): onAdFailedToLoad: 0 I/Ads (21375): Ad failed to load : 0 I/flutter (21375): InterstitialAd event MobileAdEvent.failedToLoad

Don't know why it's not working, although I've added testDevice id along with targetingInfo

To Reproduce

1. Simply run the example code provided by firebase_admob at 'https://pub.dev/packages/firebase_admob/example'
2. Create Project on AdMob and create Banner, Interstitial, Reward ad units
3. Copy their id values and place them in app respectively
2. Everything works fine unless you add test device id and replace testing app id & unit id(s) with your own created id(s) at adMob

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.20.0, on Microsoft Windows [Version 10.0.18362.30], locale en-PK)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.50.1)
[√] Connected device (1 available)

β€’ No issues found!

Flutter dependencies

Dart SDK 2.9.0-5.0.dev.flutter-eca696c026
Flutter SDK 1.20.0
awesome_drawing_quiz 1.0.0+1

dependencies:
- firebase_admob 0.10.0+2 [meta flutter firebase_core]
- firebase_core 0.5.0+1 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- flutter 0.0.0 [collection meta typed_data vector_math sky_engine]
- google_fonts 0.3.10 [flutter http path_provider crypto]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]

transitive dependencies:
- async 2.4.1 [collection]
- boolean_selector 2.0.0 [source_span string_scanner]
- charcode 1.1.3
- clock 1.0.1 [meta]
- collection 1.14.12
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.4 [collection convert typed_data]
- fake_async 1.1.0 [clock collection]
- firebase 7.3.2 [http http_parser js]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter collection meta typed_data vector_math]
- http 0.12.0+4 [async http_parser path pedantic]
- http_parser 3.1.3 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- matcher 0.12.6 [stack_trace]
- meta 1.1.8
- path 1.7.0
- path_provider 1.6.5 [flutter path_provider_platform_interface path_provider_macos]
- path_provider_macos 0.0.4 [flutter]
- path_provider_platform_interface 1.0.1 [flutter meta platform plugin_platform_interface]
- pedantic 1.8.0+1
- platform 2.2.1
- plugin_platform_interface 1.0.2 [meta]
- quiver 2.1.3 [matcher meta]
- sky_engine 0.0.99
- source_span 1.7.0 [charcode collection meta path term_glyph]
- stack_trace 1.9.3 [path]
- stream_channel 2.0.0 [async]
- string_scanner 1.0.5 [charcode meta source_span]
- term_glyph 1.1.0
- test_api 0.2.15 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.1.6
- vector_math 2.0.8

Capture

markusaksli-nc commented 4 years ago

Hi @mshahzaib1629 Have you followed the documentation for setting up Admob? How long has it been since you created the adUnit in Admob? Can you provide your flutter run -v in a plain text file? Thank you

mshahzaib1629 commented 4 years ago

@markusaksli-nc as mentioned in pub.dev, admob library don't have any documentation ready so far, I followed the given example simply by replacing the application id and unit id (s), and produces the mentioned error.

markusaksli-nc commented 4 years ago

@mshahzaib1629 Is your compileSdkVersion and targetSdkVersion set to at least 29 in build.gradle?

google-oss-bot commented 3 years ago

Hey @mshahzaib1629. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

bombicode commented 3 years ago

Same problem. Only the test id works. On Android it works on ios it doesn't work. ad created 14 days ago

danieeelfc commented 3 years ago

@mshahzaib1629 , have you managed to solve it? I'm getting the same issue here. Test ads work fine. Real ads do not show. My app is published on App Store for a week now. I'm getting 400+ requests but zero impressions.

markusaksli-nc commented 3 years ago

@bombicode @danieeelfc Is anything useful logged to the console with flutter run -v? Have you removed all test device ID etc code from the app?

Labeling since this is an issue for multiple people already.

mshahzaib1629 commented 3 years ago

@danieeelfc the problem is still there. But I tackled it by changing admob account. The first account was newly created (tested for a week but it didn't work). Then I used another account of a friend who has added payment information in it, and it worked surprisingly. I think absence of payment information in admob account was causing the issue.

danieeelfc commented 3 years ago

@markusaksli-nc Thank you for your attention. Running flutter run --verbose the only hint I get is this: Failed to load event is triggered: "flutter: BannerAd event is MobileAdEvent.failedToLoad"

and on Xcode console I get this message: FirebaseAdMobPlugin <warning> interstitial:didFailToReceiveAdWithError: Request Error: No ad to show. (MobileAd <FLTInterstitialAd: 0x283553d80> PENDING mobileAdId:750245609 for: <GADInterstitial: 0x280bd64c0>)

@mshahzaib1629 Thanks for your reply. My account is set up. Indeed I have published three other apps this year that are showing ads accordingly.

SagarDhiman018 commented 3 years ago

Hi all, Anybody found solution for ios real device? it's working fine in both simulators (android and ios) and in android real device. thanks in advance.

bombicode commented 3 years ago

@mshahzaib1629 , have you managed to solve it? I'm getting the same issue here. Test ads work fine. Real ads do not show. My app is published on App Store for a week now. I'm getting 400+ requests but zero impressions.

Have you solved the problem?

danieeelfc commented 3 years ago

@bombicode not yet

bombicode commented 3 years ago

@bombicode not yet

I also noticed that if you try link an app to the app store, the app is not there although the app was approved 12 hours ago and can be found in the app store

danieeelfc commented 3 years ago

@bombicode It's something on admob cache update schedule. Usually it takes 2-3 weeks for an iOS app published on App Store show on Admob. Mine is up for 10 days and still doesn't show up. I'm hoping it will get impressions as soon as I can link app store to admob app.

bombicode commented 3 years ago

@bombicode It's something on admob cache update schedule. Usually it takes 2-3 weeks for an iOS app published on App Store show on Admob. Mine is up for 10 days and still doesn't show up. I'm hoping it will get impressions as soon as I can link app store to admob app.

after 20 days, I got an ad.

iambhavesh commented 3 years ago

I am also facing the same issue. Test ads are running fine, but when I add AppId and AdId it says Ad failed to load : 3. Have anyone found a solution on this

nathanogunleye commented 3 years ago

I'm also seeing the same issue:

W/flutter (20936): onAdFailedToLoad: 3
I/Ads     (20936): Ad failed to load : 3
I/flutter (20936): BannerAd event is MobileAdEvent.failedToLoad

How long does it take to show up for a Android app?

bombicode commented 3 years ago

I am also facing the same issue. Test ads are running fine, but when I add AppId and AdId it says Ad failed to load : 3. Have anyone found a solution on this

after 20 days, I got an ad.

kdm7173icomer commented 3 years ago

I had same issue. But, now problem has been solved by itself.. I just wait for 2 weeks after release my app on appstore. I think only we can do for this issue is JUST WAIT......

teerasej commented 3 years ago

I'm also seeing the same issue:

W/flutter (20936): onAdFailedToLoad: 3
I/Ads     (20936): Ad failed to load : 3
I/flutter (20936): BannerAd event is MobileAdEvent.failedToLoad

How long does it take to show up for a Android app?

Same result here. Hope I can get ads after release its for a while.

russellwheatley commented 3 years ago

The firebase_admob plugin will be deprecated in April 2021 in favor of Google Mobile Ads SDK for Flutter. Google Mobile Ads SDK for Flutter is a new Flutter plugin that supports more Ads formats than firebase_admob does. Google Mobile Ads SDK for Flutter currently supports loading and displaying banner, interstitial (full-screen), native ads, and rewarded video ads across AdMob and AdManager. It also supports displaying banner and native ads as Widgets as opposed to being overlayed over all app content. We're now recommending projects currently using firebase_admob migrate to Google Mobile Ads SDK for Flutter following the instructions outlined here. Issues with migrating or with using the new package should now be raised over on the Google Mobile Ads SDK for Flutter repository.