AdMob 测试广告不再出现,显示无广告配置错误消息
AdMob test ads no longer appear, showing No ad config error message
我正在尝试在我的应用中测试广告,我正在使用以下测试广告单元:
<string name="APP_ID">ca-app-pub-3940256099942544~3347511713</string>
<string name="INTERSTITIAL_ADMOB">ca-app-pub-3940256099942544/1033173712</string>
InterstitialAd.load(activity, StringUtils.getString(R.string.INTERSTITIAL_ADMOB), adRequest, new InterstitialAdLoadCallback() {
@Override
public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {
interstitialAd.show(activity);
interstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
@Override
public void onAdDismissedFullScreenContent() {
adsCallBack.onAdClosed();
Log.d("TAG", "The ad was dismissed.");
}
@Override
public void onAdShowedFullScreenContent() {
Log.d("TAG", "The ad was shown.");
}
});
}
@Override
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
Log.d("AdMob", "==> " +loadAdError.getMessage());
}
});
我总是得到:没有广告配置
我已将以下行添加到我的 app-ads.txt
google.com, pub-3940256099942544, DIRECT, f08c47fec0942fa0
AdMob SDK :
implementation 'com.google.android.gms:play-services-ads:20.4.0'
响应信息:
{
"Response ID": "null",
"Mediation Adapter Class Name": "",
"Adapter Responses": []
}
注意:真实广告效果很好,但测试广告没有。
解决方案是将 AdMob SDK 更新为 20.5.0
我正在尝试在我的应用中测试广告,我正在使用以下测试广告单元:
<string name="APP_ID">ca-app-pub-3940256099942544~3347511713</string>
<string name="INTERSTITIAL_ADMOB">ca-app-pub-3940256099942544/1033173712</string>
InterstitialAd.load(activity, StringUtils.getString(R.string.INTERSTITIAL_ADMOB), adRequest, new InterstitialAdLoadCallback() {
@Override
public void onAdLoaded(@NonNull InterstitialAd interstitialAd) {
interstitialAd.show(activity);
interstitialAd.setFullScreenContentCallback(new FullScreenContentCallback() {
@Override
public void onAdDismissedFullScreenContent() {
adsCallBack.onAdClosed();
Log.d("TAG", "The ad was dismissed.");
}
@Override
public void onAdShowedFullScreenContent() {
Log.d("TAG", "The ad was shown.");
}
});
}
@Override
public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
Log.d("AdMob", "==> " +loadAdError.getMessage());
}
});
我总是得到:没有广告配置
我已将以下行添加到我的 app-ads.txt
google.com, pub-3940256099942544, DIRECT, f08c47fec0942fa0
AdMob SDK :
implementation 'com.google.android.gms:play-services-ads:20.4.0'
响应信息:
{
"Response ID": "null",
"Mediation Adapter Class Name": "",
"Adapter Responses": []
}
注意:真实广告效果很好,但测试广告没有。
解决方案是将 AdMob SDK 更新为 20.5.0