RewardedVideoAd - AdMob Mediation with Vungle - 错误代码:3
RewardedVideoAd - AdMob Mediation with Vungle - ErrorCode: 3
这是我第一次使用视频广告。我已遵循 AdMob 指南实施 RewardedVideoAd
from here and the documentation of Vungle from here。我完成了这些指南中写的所有步骤。但是,当我在手机上部署我的应用程序时,RewardedVideoAd
总是加载失败。我在手机和模拟器上对其进行了测试,其中 none 有效。它总是调用 onRewardedVideoAdFailedToLoad。我在两台设备上都安装了最新的 Google Play 服务。如果这对您很重要,我的应用程序仍未部署在 Play 商店中。我不知道出了什么问题。有人可以指出问题吗?
错误代码为 3:ERROR_CODE_NO_FILL
我的代码:
public class HomeScreen extends Activity {
RewardedVideoAd videoAd;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home_screen);
//Some Code
videoAd = MobileAds.getRewardedVideoAdInstance(this);
videoAd.setRewardedVideoAdListener(new RewardedVideoAdListener() {
@Override
public void onRewarded(RewardItem reward) {
Toast.makeText(HomeScreen.this, "onRewarded! currency: " + reward.getType() + " amount: " +
reward.getAmount(), Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdLeftApplication() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdLeftApplication",
Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdClosed() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdClosed", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdFailedToLoad", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdLoaded() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdLoaded", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdOpened() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdOpened", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoStarted() {
Toast.makeText(HomeScreen.this, "onRewardedVideoStarted", Toast.LENGTH_SHORT).show();
}
});
Bundle extrasBundle = new Bundle();
extrasBundle.putBoolean("_noRefresh", true);
AdRequest adRequest = new AdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter.class, extrasBundle)
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("D575C31D492903A3BA451D2B2E2BD8E8")
.build();
videoAd.loadAd(getString(R.string.video_ad_unit_id), adRequest);
addLives.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (videoAd.isLoaded()) {
videoAd.show();
}
}
});
}
}
AdMob 广告:
广告中介:
我已经添加了 Vungle 中介所需的库:
Gradle(项目级):
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}
Gradle(应用级):
apply plugin: 'com.google.gms.google-services'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.firebase:firebase-ads:9.2.0'
}
Logcat(关于广告):
I/Ads: Starting ad request.
W/Ads: Failed to load ad: 3
我是 Vungle 的 Aki。我们正在调查这个问题。我们将在验证后更新此线程。
谢谢,
此问题已通过 Vungle Android SDK 4.0.2 和 Vungle AdMob Adopter 2.0.0
解决
https://v.vungle.com/sdk
https://support.vungle.com/hc/en-us/articles/207604108
这是我第一次使用视频广告。我已遵循 AdMob 指南实施 RewardedVideoAd
from here and the documentation of Vungle from here。我完成了这些指南中写的所有步骤。但是,当我在手机上部署我的应用程序时,RewardedVideoAd
总是加载失败。我在手机和模拟器上对其进行了测试,其中 none 有效。它总是调用 onRewardedVideoAdFailedToLoad。我在两台设备上都安装了最新的 Google Play 服务。如果这对您很重要,我的应用程序仍未部署在 Play 商店中。我不知道出了什么问题。有人可以指出问题吗?
错误代码为 3:ERROR_CODE_NO_FILL
我的代码:
public class HomeScreen extends Activity {
RewardedVideoAd videoAd;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home_screen);
//Some Code
videoAd = MobileAds.getRewardedVideoAdInstance(this);
videoAd.setRewardedVideoAdListener(new RewardedVideoAdListener() {
@Override
public void onRewarded(RewardItem reward) {
Toast.makeText(HomeScreen.this, "onRewarded! currency: " + reward.getType() + " amount: " +
reward.getAmount(), Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdLeftApplication() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdLeftApplication",
Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdClosed() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdClosed", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdFailedToLoad", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdLoaded() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdLoaded", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoAdOpened() {
Toast.makeText(HomeScreen.this, "onRewardedVideoAdOpened", Toast.LENGTH_SHORT).show();
}
@Override
public void onRewardedVideoStarted() {
Toast.makeText(HomeScreen.this, "onRewardedVideoStarted", Toast.LENGTH_SHORT).show();
}
});
Bundle extrasBundle = new Bundle();
extrasBundle.putBoolean("_noRefresh", true);
AdRequest adRequest = new AdRequest.Builder()
.addNetworkExtrasBundle(AdMobAdapter.class, extrasBundle)
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("D575C31D492903A3BA451D2B2E2BD8E8")
.build();
videoAd.loadAd(getString(R.string.video_ad_unit_id), adRequest);
addLives.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (videoAd.isLoaded()) {
videoAd.show();
}
}
});
}
}
AdMob 广告:
广告中介:
我已经添加了 Vungle 中介所需的库:
Gradle(项目级):
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}
Gradle(应用级):
apply plugin: 'com.google.gms.google-services'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.firebase:firebase-ads:9.2.0'
}
Logcat(关于广告):
I/Ads: Starting ad request.
W/Ads: Failed to load ad: 3
我是 Vungle 的 Aki。我们正在调查这个问题。我们将在验证后更新此线程。
谢谢,
此问题已通过 Vungle Android SDK 4.0.2 和 Vungle AdMob Adopter 2.0.0
解决https://v.vungle.com/sdk https://support.vungle.com/hc/en-us/articles/207604108