Flutter 未找到广告单元的广告-Mopub_颤振

Flutter 未找到广告单元的广告-Mopub_颤振,flutter,mopub,Flutter,Mopub,我正在尝试将Mopub实现到我的Flutter项目中,但我有一些与之相关的问题 MopubAdManager类包含Mopub stuff的ID 这是我的状态: void initState() { try { MoPub.init(MopubAdManager().publisherId, testMode: true).then((_) => { loadRewardedAd(), }); } catch (e) { print('exceptio

我正在尝试将Mopub实现到我的Flutter项目中,但我有一些与之相关的问题

MopubAdManager类包含Mopub stuff的ID

这是我的状态:

  void initState() {
try {
  MoPub.init(MopubAdManager().publisherId, testMode: true).then((_) => {
        loadRewardedAd(),
      });
} catch (e) {
  print('exception: ${e.toString()}');
}
super.initState();
这是loadRewaredAd函数

  void loadRewardedAd() {
videoAd = MoPubRewardedVideoAd(MopubAdManager().rewardedAd, (result, args) {
  setState(() {
    var rewardedResult = '${result.toString()}____$args';
  });
  print('$result');
  if (result == RewardedVideoAdResult.GRANT_REWARD) {
    print('Grant reward: $args');
  }
}, reloadOnClosed: true);
这就是我在按下onPressed时调用按钮内部函数的方式

                              RaisedButton(
                              child: Text('Show Video'),
                              onPressed: () async {
                                videoAd.load();
                                var result = await videoAd.isReady();
                                print('Is Ready $result');
                                if (result) {
                                  videoAd.show();
                                }
                              },
                            ),
在触摸按钮之前,Mopub会在console中打印该行:

I/MoPub   (30148): [com.mopub.network.TrackingRequest$1][onResponse] SDK Log - Successfully hit tracking endpoint: https://ads.mopub.com/m/open
    V/AudioManager(30148): querySoundEffectsEnabled...
I/MoPub   (30148): [com.mopub.mobileads.MoPubRewardedVideoManager][fetchAd] SDK Log - Loading rewarded ad request for ad unit 40825097a53247c5a91f9775d3f54298 with URL https://ads.mopub.com/m/ad?v=6&id=40825097a53247c5a91f9775d3f54298&nv=5.15.0&dn=HUAWEI%2CPOT-LX1%2CPOT-LX1&bundle=com.example.anket&z=%2B0300&o=p&cw=1080&ch=2259&w=1080&h=2340&sc=3.0&ct=2&av=1.0.0&abt=%7B%22tapjoy%22%3A%7B%22token%22%3A%221%22%7D%7D&ifa=mp_tmpl_advertising_id&dnt=mp_tmpl_do_not_track&tas=mp_tmpl_tas&mid=mp_tmpl_mopub_id&gdpr_applies=0&force_gdpr_applies=0&current_consent_status=unknown&vv=4&vver=1.3.4-Mopub&mr=1
I/MoPub   (30148): [com.mopub.network.AdLoader][fetchAd] Ad requesting from AdServer: https://ads.mopub.com/m/ad
I/MoPub   (30148): {"vv":"4","nv":"5.15.0","mid":"e458ffd9-db59-4753-9878-c923a99ef3fc","dn":"HUAWEI,POT-LX1,POT-LX1","sc":"3.0","current_consent_status":"unknown","vver":"1.3.4-Mopub","id":"40825097a53247c5a91f9775d3f54298","bundle":"com.example.anket","gdpr_applies":"0","ch":"2259","ifa":"fe6b229f-fa21-4367-ac77-f8437ef7ebb6","mr":"1","tas":"authorized","h":"2340","force_gdpr_applies":"0","dnt":"0","o":"p","ct":"2","abt":"{\"tapjoy\":{\"token\":\"1\"}}","cw":"1080","av":"1.0.0","v":"6","w":"1080","z":"+0300"}
I/flutter (30148): Is Ready false
I/MoPub   (30148): [com.mopub.network.MultiAdResponse][parseSingleAdResponse] Ad server responded with:
I/MoPub   (30148): {"content":"","metadata":{"x-adtype":"clear","x-backfill":"clear","x-refreshtime":60}}
I/MoPub   (30148): [com.mopub.network.AdLoader$1][onErrorResponse] Ad server responded with:
I/MoPub   (30148): No ads found for ad unit.
I/flutter (30148): Flutter mopub rewarded method error
I/flutter (30148): RewardedVideoAdResult.ERROR
触摸控制台中显示的“显示视频”按钮后:

I/MoPub   (30148): [com.mopub.network.TrackingRequest$1][onResponse] SDK Log - Successfully hit tracking endpoint: https://ads.mopub.com/m/open
    V/AudioManager(30148): querySoundEffectsEnabled...
I/MoPub   (30148): [com.mopub.mobileads.MoPubRewardedVideoManager][fetchAd] SDK Log - Loading rewarded ad request for ad unit 40825097a53247c5a91f9775d3f54298 with URL https://ads.mopub.com/m/ad?v=6&id=40825097a53247c5a91f9775d3f54298&nv=5.15.0&dn=HUAWEI%2CPOT-LX1%2CPOT-LX1&bundle=com.example.anket&z=%2B0300&o=p&cw=1080&ch=2259&w=1080&h=2340&sc=3.0&ct=2&av=1.0.0&abt=%7B%22tapjoy%22%3A%7B%22token%22%3A%221%22%7D%7D&ifa=mp_tmpl_advertising_id&dnt=mp_tmpl_do_not_track&tas=mp_tmpl_tas&mid=mp_tmpl_mopub_id&gdpr_applies=0&force_gdpr_applies=0&current_consent_status=unknown&vv=4&vver=1.3.4-Mopub&mr=1
I/MoPub   (30148): [com.mopub.network.AdLoader][fetchAd] Ad requesting from AdServer: https://ads.mopub.com/m/ad
I/MoPub   (30148): {"vv":"4","nv":"5.15.0","mid":"e458ffd9-db59-4753-9878-c923a99ef3fc","dn":"HUAWEI,POT-LX1,POT-LX1","sc":"3.0","current_consent_status":"unknown","vver":"1.3.4-Mopub","id":"40825097a53247c5a91f9775d3f54298","bundle":"com.example.anket","gdpr_applies":"0","ch":"2259","ifa":"fe6b229f-fa21-4367-ac77-f8437ef7ebb6","mr":"1","tas":"authorized","h":"2340","force_gdpr_applies":"0","dnt":"0","o":"p","ct":"2","abt":"{\"tapjoy\":{\"token\":\"1\"}}","cw":"1080","av":"1.0.0","v":"6","w":"1080","z":"+0300"}
I/flutter (30148): Is Ready false
I/MoPub   (30148): [com.mopub.network.MultiAdResponse][parseSingleAdResponse] Ad server responded with:
I/MoPub   (30148): {"content":"","metadata":{"x-adtype":"clear","x-backfill":"clear","x-refreshtime":60}}
I/MoPub   (30148): [com.mopub.network.AdLoader$1][onErrorResponse] Ad server responded with:
I/MoPub   (30148): No ads found for ad unit.
I/flutter (30148): Flutter mopub rewarded method error
I/flutter (30148): RewardedVideoAdResult.ERROR
其他广告类型,如横幅广告、插页广告,也显示了相同的错误

我已经创建了广告单元,并将ID复制到MopubAdManager类,但应用程序中没有出现广告。我已经测试了测试ID,它们工作得非常好


我跳过了什么吗?

你能解决这个问题吗?@GibreelAbdullah我怀疑这是关于应用程序在区域运行的地方。因此,如果您所在的地方不使用MoPub广告服务发布广告,您可能无法在应用程序中显示MoPub广告。因此,部署后您开始获得收入?不。据我所知,我所在地区在Mopub没有任何出版商。因此,我在我的应用程序中没有收到任何广告,也没有获得任何收入。