googleads / googleads-mobile-flutter

A Flutter plugin for the Google Mobile Ads SDK
Apache License 2.0
341 stars 285 forks source link

Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target. #363

Closed AnhTu6610 closed 1 year ago

AnhTu6610 commented 3 years ago
Running Xcode build...                                                  
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
 └─Compiling, linking and signing...                         7.5s
Xcode build done.                                           34.4s
<Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ kGADSimulatorID ];
flutter: |-->Language: vi                                               
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
Syncing files to device iPhone 12 Pro Max...                       411ms

Flutter run key commands.
r Hot reload. πŸ”₯πŸ”₯πŸ”₯
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

πŸ’ͺ Running with sound null safety πŸ’ͺ

An Observatory debugger and profiler on iPhone 12 Pro Max is available at: http://127.0.0.1:53598/86K7-03DqdI=/
The Flutter DevTools debugger and profiler on iPhone 12 Pro Max is available at:
http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A53598%2F86K7-03DqdI%3D%2F
flutter: |---> Route: /home
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
flutter: --------------> NativeAd failedToLoad: LoadAdError(code: 8, domain: com.google.admob, message: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target., responseInfo: ResponseInfo(responseId: X0czYfSZENGtwgOm6bmIDg, mediationAdapterClassName: null, adapterResponses: [AdapterResponseInfo(adapterClassName: com.google.DummyAdapter, latencyMillis: 1), description: {
    Credentials =     {
    };
    Error = "Error Domain=com.google.admob Code=8 \"Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.\" UserInfo={NSLocalizedDescription=Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in th<…>
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
flutter: |---> Route: /detail
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
flutter: InterstitialAd failed to load: LoadAdError(code: 8, domain: com.google.admob, message: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target., responseInfo: ResponseInfo(responseId: aUczYYj3BMixwgOEhbFg, mediationAdapterClassName: null, adapterResponses: [AdapterResponseInfo(adapterClassName: com.google.DummyAdapter, latencyMillis: 1), description: {
    Credentials =     {
    };
    Error = "Error Domain=com.google.admob Code=8 \"Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.\" UserInfo={NSLocalizedDescription=Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other L<…>
flutter: --------------> NativeAd failedToLoad: LoadAdError(code: 8, domain: com.google.admob, message: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target., responseInfo: ResponseInfo(responseId: aUczYanUBZawvATU9oywAQ, mediationAdapterClassName: null, adapterResponses: [AdapterResponseInfo(adapterClassName: com.google.DummyAdapter, latencyMillis: 1), description: {
    Credentials =     {
    };
    Error = "Error Domain=com.google.admob Code=8 \"Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.\" UserInfo={NSLocalizedDescription=Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in th<…>
<Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
maheshj01 commented 3 years ago

Hi @AnhTu6610, Thanks for filing the issue. When filing issues please try to fill some or all of the information requested in the issue template. To investigate the issue further please share the output of flutter doctor -v and add some description and steps to reproduce the issue. Also make sure you are using the correct ad units id.

AnhTu6610 commented 3 years ago

Hi @AnhTu6610, Thanks for filing the issue. When filing issues please try to fill some or all of the information requested in the issue template. To investigate the issue further please share the output of flutter doctor -v and add some description and steps to reproduce the issue. Also make sure you are using the correct ad units id.

flutter doctor -v

[βœ“] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-x64, locale en-VN)
    β€’ Flutter version 2.2.3 at /Users/mbprolt85/flutter
    β€’ Framework revision f4abaa0735 (10 weeks ago), 2021-07-01 12:46:11 -0700
    β€’ Engine revision 241c87ad80
    β€’ Dart version 2.13.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    β€’ Android SDK at /Users/mbprolt85/Library/Android/sdk
    β€’ Platform android-30, build-tools 30.0.3
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    βœ— Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[βœ“] Xcode - develop for iOS and macOS
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 12.5.1, Build version 12E507
    β€’ CocoaPods version 1.11.0.rc.1

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 4.2)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[βœ“] VS Code (version 1.60.0)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.26.0

[βœ“] Connected device (1 available)
    β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 93.0.4577.63
maheshj01 commented 3 years ago

@AnhTu6610 Please make sure you are using the correct ad unit ids does the ad load with test unit ids? Also what version of the ads plugin are you having issues with? Can you share a minimal reproducible code?

AnhTu6610 commented 3 years ago

i am using test unit ids and google_mobile_ads: ^0.13.4

maheshj01 commented 3 years ago

Is this issue on Android/ IOS / both? with all types of ads or specific ad? can you please try running this code sample and also please go through the docs and make sure you satisfy the Prerequisites.

code sample ```dart import 'dart:io'; import 'package:flutter/material.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; import 'reusable_inline_example.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); MobileAds.instance.initialize(); runApp(MyApp()); } // You can also test with your own ad unit IDs by registering your device as a // test device. Check the logs for your device's ID value. const String testDevice = 'YOUR_DEVICE_ID'; const int maxFailedLoadAttempts = 3; class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { static final AdRequest request = AdRequest( keywords: ['foo', 'bar'], contentUrl: 'http://foo.com/bar.html', nonPersonalizedAds: true, ); InterstitialAd? _interstitialAd; int _numInterstitialLoadAttempts = 0; RewardedAd? _rewardedAd; int _numRewardedLoadAttempts = 0; BannerAd? _anchoredBanner; bool _loadingAnchoredBanner = false; @override void initState() { super.initState(); _createInterstitialAd(); _createRewardedAd(); } void _createInterstitialAd() { InterstitialAd.load( adUnitId: InterstitialAd.testAdUnitId, request: request, adLoadCallback: InterstitialAdLoadCallback( onAdLoaded: (InterstitialAd ad) { print('$ad loaded'); _interstitialAd = ad; _numInterstitialLoadAttempts = 0; _interstitialAd!.setImmersiveMode(true); }, onAdFailedToLoad: (LoadAdError error) { print('InterstitialAd failed to load: $error.'); _numInterstitialLoadAttempts += 1; _interstitialAd = null; if (_numInterstitialLoadAttempts <= maxFailedLoadAttempts) { _createInterstitialAd(); } }, )); } void _showInterstitialAd() { if (_interstitialAd == null) { print('Warning: attempt to show interstitial before loaded.'); return; } _interstitialAd!.fullScreenContentCallback = FullScreenContentCallback( onAdShowedFullScreenContent: (InterstitialAd ad) => print('ad onAdShowedFullScreenContent.'), onAdDismissedFullScreenContent: (InterstitialAd ad) { print('$ad onAdDismissedFullScreenContent.'); ad.dispose(); _createInterstitialAd(); }, onAdFailedToShowFullScreenContent: (InterstitialAd ad, AdError error) { print('$ad onAdFailedToShowFullScreenContent: $error'); ad.dispose(); _createInterstitialAd(); }, ); _interstitialAd!.show(); _interstitialAd = null; } void _createRewardedAd() { RewardedAd.load( adUnitId: RewardedAd.testAdUnitId, request: request, rewardedAdLoadCallback: RewardedAdLoadCallback( onAdLoaded: (RewardedAd ad) { print('$ad loaded.'); _rewardedAd = ad; _numRewardedLoadAttempts = 0; }, onAdFailedToLoad: (LoadAdError error) { print('RewardedAd failed to load: $error'); _rewardedAd = null; _numRewardedLoadAttempts += 1; if (_numRewardedLoadAttempts <= maxFailedLoadAttempts) { _createRewardedAd(); } }, )); } void _showRewardedAd() { if (_rewardedAd == null) { print('Warning: attempt to show rewarded before loaded.'); return; } _rewardedAd!.fullScreenContentCallback = FullScreenContentCallback( onAdShowedFullScreenContent: (RewardedAd ad) => print('ad onAdShowedFullScreenContent.'), onAdDismissedFullScreenContent: (RewardedAd ad) { print('$ad onAdDismissedFullScreenContent.'); ad.dispose(); _createRewardedAd(); }, onAdFailedToShowFullScreenContent: (RewardedAd ad, AdError error) { print('$ad onAdFailedToShowFullScreenContent: $error'); ad.dispose(); _createRewardedAd(); }, ); _rewardedAd!.setImmersiveMode(true); _rewardedAd!.show(onUserEarnedReward: (RewardedAd ad, RewardItem reward) { print('$ad with reward $RewardItem(${reward.amount}, ${reward.type}'); }); _rewardedAd = null; } Future _createAnchoredBanner(BuildContext context) async { final AnchoredAdaptiveBannerAdSize? size = await AdSize.getAnchoredAdaptiveBannerAdSize( Orientation.portrait, MediaQuery.of(context).size.width.truncate(), ); if (size == null) { print('Unable to get height of anchored banner.'); return; } final BannerAd banner = BannerAd( size: size, request: request, adUnitId: Platform.isAndroid ? 'ca-app-pub-3940256099942544/6300978111' : 'ca-app-pub-3940256099942544/2934735716', listener: BannerAdListener( onAdLoaded: (Ad ad) { print('$BannerAd loaded.'); setState(() { _anchoredBanner = ad as BannerAd?; }); }, onAdFailedToLoad: (Ad ad, LoadAdError error) { print('$BannerAd failedToLoad: $error'); ad.dispose(); }, onAdOpened: (Ad ad) => print('$BannerAd onAdOpened.'), onAdClosed: (Ad ad) => print('$BannerAd onAdClosed.'), ), ); return banner.load(); } @override void dispose() { super.dispose(); _interstitialAd?.dispose(); _rewardedAd?.dispose(); _anchoredBanner?.dispose(); } @override Widget build(BuildContext context) { return MaterialApp( home: Builder(builder: (BuildContext context) { if (!_loadingAnchoredBanner) { _loadingAnchoredBanner = true; _createAnchoredBanner(context); } return Scaffold( appBar: AppBar( title: const Text('AdMob Plugin example app'), actions: [ PopupMenuButton( onSelected: (String result) { switch (result) { case 'InterstitialAd': _showInterstitialAd(); break; case 'RewardedAd': _showRewardedAd(); break; default: throw AssertionError('unexpected button: $result'); } }, itemBuilder: (BuildContext context) => >[ PopupMenuItem( value: '$InterstitialAd', child: Text('$InterstitialAd'), ), PopupMenuItem( value: '$RewardedAd', child: Text('$RewardedAd'), ), ], ), ], ), body: SafeArea( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ if (_anchoredBanner != null) Container( color: Colors.green, width: _anchoredBanner!.size.width.toDouble(), height: _anchoredBanner!.size.height.toDouble(), child: AdWidget(ad: _anchoredBanner!), ), ], ), ), ); }), ); } } ```
AnhTu6610 commented 3 years ago

i use ad unit ids it works, but using test unit ids it doesn't work. Only error on ios

maheshj01 commented 3 years ago

@AnhTu6610, please share a reproducible code sample or a git repo to further investigate the issue. And also which IOS device are you having issues with?

pynner commented 3 years ago

Having same issue with test ad unit ids

rocboronat commented 3 years ago

Exactly the same here. I have the interstitials working but the banner ones launch this error 😒

In addition, just in case, I added -ObjC to my Other Linker Flags setting. Is it really needed? While this error says `Remember to link...", the readme says nothing about it.

maheshj01 commented 3 years ago

I can't reproduce the issue the interstitial and banner ads both work fine for me with test Ids. Labeling this issue as a bug for further investigation.

cc: @jjliu15

rocboronat commented 3 years ago

Hello @maheshmnj! In case you need, I could do a call to showcase the issue :)

maheshj01 commented 3 years ago

@rocboronat, sure please that would be much helpful.

rocboronat commented 3 years ago

@maheshmnj I'll drop you a line on Twitter 🐦

maheshj01 commented 3 years ago

In case you need, I could do a call to showcase the issue :)

Ohh, sorry I did not construe it as an actual call, Probably that's not required, you could just share more details here in the thread so that it helps the team members working on this issue.

rafiqueud commented 3 years ago

Same situation here, any solution?

rafiqueud commented 3 years ago

Same situation here, any solution?

Using iOS 15 simulator.

Flutter sdk: '>=2.12.0 <3.0.0'
google_mobile_ads: 0.13.5

environment:
  sdk: '>=2.12.0 <3.0.0'

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  http: 0.13.3
  share: 2.0.4
  transparent_image: 2.0.0
  url_launcher: 6.0.11
  fluro: 2.0.3
  flutter_launcher_icons: 0.9.2
  cupertino_icons: 1.0.3
  google_mobile_ads: 0.13.5
  firebase_messaging: 10.0.7
  shared_preferences: 2.0.8
  fluttertoast: 8.0.8
  glassmorphism: 3.0.0
  flutter_blurhash: 0.6.0
  sortedmap: 0.5.1
  json_annotation: 4.1.0
  flutter_card_swipper: 0.4.0
  scrollable_positioned_list: 0.2.0-nullsafety.0
  youtube_player_iframe: ^2.2.2
  shimmer: 2.0.0
  cached_network_image: ^3.1.0
junqi commented 3 years ago

Same situation. And I noticed that my ad was disabled because I haven't received PIN. Is this related to this issue? ( I'm going to apply resending PIN )

Below is my Admob home. image

erperejildo commented 2 years ago

For me is working on Android but not on iOS

maheshj01 commented 2 years ago

@AnhTu6610 is this issue resolved?

andaas4 commented 2 years ago

I still have this issue with version 1.0.1.

maheshj01 commented 2 years ago

I think its good to leave this issue open until we are sure that this is fixed.

manusbreuking commented 2 years ago

I'm getting this error as well. This is the log running in xcode: 2021-12-14 23:02:36.160970+0100 Runner[61261:8949445] <Google> To get test ads on this device, set: Objective-C GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ kGADSimulatorID ]; Swift GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ kGADSimulatorID ] 2021-12-14 23:02:36.760970+0100 Runner[61261:8950164] [boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics 2021-12-14 23:02:36.846160+0100 Runner[61261:8950163] <Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target. 2021-12-14 23:02:36.926166+0100 Runner[61261:8950189] [boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics 2021-12-14 23:02:36.928422+0100 Runner[61261:8950189] [boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics 2021-12-14 23:02:36.953325+0100 Runner[61261:8950166] <Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target. 2021-12-14 23:02:36.965590+0100 Runner[61261:8949756] flutter: Ad failed to load: ca-app-pub-3940256099942544/2934735716, LoadAdError(code: 8, domain: com.google.admob, message: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target., responseInfo: ResponseInfo(responseId: fBS5YaT5O4mrtwfqk7GYDQ, mediationAdapterClassName: null, adapterResponses: [AdapterResponseInfo(adapterClassName: com.google.DummyAdapter, latencyMillis: 1), description: { Credentials = { }; Error = "Error Domain=com.google.admob Code=8 \"Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.\" UserInfo={NSLocalizedDescription=Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.}"; Latency = "0.001"; Network = "com.google.DummyAdapter"; }, credentials: { }, adError: AdError(code: 8, domain: com.google.admob, message: Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.))])).

No Ads are shown.

If I change the Bundle Identifier in xcode (ie: by adding a 1 at the end) and run the project ads are shown. Unfortunately this will not work for me since changing the bundle identifier is a no go for me.

lsamaria commented 2 years ago

pod 'Google-Mobile-Ads-SDK' FirebaseAnalytics/AdIdSupport (8.9.1) Firebase (8.9.1):

Xcode -Version 12.4 (12D4e) iPad Simulator -12.9 inch 3rd Generation

I'm having this issue with banner ad testAdID units when rotating on an iPad to landscape. For example in Portrait the test ad shows and works fine but once I rotate the iPad to landscape I get

Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.

The odd thing is once I rotate back to portrait the ad appears.

This process is non-stop. The ad always shows in portrait but nothing shows in landscape with the same above error message

I looked in Target > Build Settings > All > Other Linker Flags and it was already set to Obj-C

Screen Shot 2021-12-19 at 6 43 28 AM

code:

// called in ViewDidLoad
func initializeAdMob() {

    let adMobKey = "ca-app-pub-3940256099942544/2934735716"

    bannerView.adUnitID = adMobKey
    bannerView.rootViewController = self
    bannerView.delegate = self

    let adSize = GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(frame.size.width)
    bannerView.adSize = adSize

    view.addSubview(bannerView)
    bannerView.heightAnchor.constraint(equalToConstant: 50).isActive = true
    bannerView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
    bannerView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
    bannerView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -15).isActive = true

    bannerView.load(GADRequest())
}
lsamaria commented 2 years ago

Answer to my issue is here. I just had to use my real ad unit id for it work

erperejildo commented 2 years ago

Answer to my issue is here. I just had to use my real ad unit id for it work

I was using the real ad unit all the time and also getting this issue on published app

[βœ“] Flutter (Channel stable, 2.8.1, on macOS 11.6.1 20G224 darwin-x64, locale en-GB)
    β€’ Flutter version 2.8.1 at /Users/dani/development/flutter
    β€’ Upstream repository https://github.com/flutter/flutter.git
    β€’ Framework revision 77d935af4d (6 days ago), 2021-12-16 08:37:33 -0800
    β€’ Engine revision 890a5fca2e
    β€’ Dart version 2.15.1

[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    β€’ Android SDK at /Users/dani/Library/Android/sdk
    β€’ Platform android-Sv2, build-tools 30.0.3
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS (Xcode 13.1)
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ CocoaPods version 1.11.2

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 2020.3)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[βœ“] VS Code (version 1.62.0)
    β€’ VS Code at /Users/dani/Desktop/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.28.0

[βœ“] Connected device (2 available)
    β€’ iPhone 11 (mobile) β€’ 6CF40450-67B5-4597-9CAB-7F0A33CB8453 β€’ ios            β€’ com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    β€’ Chrome (web)       β€’ chrome                               β€’ web-javascript β€’ Google Chrome 96.0.4664.110

β€’ No issues found!

This issue was created almost 4 months ago. Any solution so far? This is showing no ads for me on iOS

gitpushforce commented 2 years ago

I had the same problem. I found this thread while googling a solution. I got it working now. I hope this helps you out. In my case im using xcode, swift. Im sorry, i dont use flutter but maybe some of you might have an idea how to apply my solution to flutter.

Basically the information of the site below helped a lot. https://developers.google.com/admob/ios/test-ads#enable_test_devices

you have 2 options. 1) If you are using app-ads.txt of admob then you have to add this line the file. google.com, pub-3940256099942544, DIRECT, f08c47fec0942fa0 Then you will get the test ads working as soon as admob confirm your new app-ads.txt.

2) add your device as a test device in admob (i think you already did it). Then check the error logs and find this part

<Google> To get test ads on this device, set: 
Objective-C
    GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"ca45365ebb00dc64001d5c16f7db427eb" ];
Swift
    GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ @"ca45365ebb00dc64001d5c16f7db427eb" ]

Im using swift, so i added Swift part to AppDelegate as below (be sure that the serial number that you got in the log is set as testDeviceIdentifier and not the number im writing in this example )

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ "ca45365ebb00dc64001d5c16f7db427eb" ]
        return true
    }

Finally, be sure you have all the ad networks are set (Info.plist in my case). This document tells you how to do it https://developers.google.com/admob/ios/quick-start

huycozy commented 1 year ago

We’re closing this issue due to inactivity. If you’re still impacted, please create a new issue via the Developer Forum.