本文介绍了RewardedVideoAd-带Vungle的AdMob中介-错误代码:3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这是我第一次使用视频广告。我遵循了AdMob指南,该指南从 广告中介: 我已添加了Vungle所需的库中介: 等级(项目级): 依赖项{ classpath'com.google.gms:google-服务:3.0.0'} 等级(应用级): 应用插件:'com.google.gms.go ogle-services的 依赖项{编译fileTree(dir:'libs',包括:['* .jar'])编译'com.google.firebase:firebase -ads:9.2.0'} Logcat(与广告有关): I / Ads:开始广告请求。 包含广告:无法加载广告:3 解决方案此问题已通过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 This is my first time working with video ads. I have followed the AdMob guide of implementing RewardedVideoAd from here and the documentation of Vungle from here. I did all the steps written in these guides. However, when I deploy my app on my mobile, the RewardedVideoAd always fails to load. I tested it on my mobile and the emulator, and none of them worked. It always calls onRewardedVideoAdFailedToLoad. I have the latest Google Play Services installed on both devices. My app is still not deployed on Play Store if that's important to you. I don't know what's wrong. Can someone point out the problem?ErrorCode is 3: ERROR_CODE_NO_FILLMy Code: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 Ad:Ad Mediation:I have added the required libraries for Vungle mediation:Gradle (project-level):dependencies { classpath 'com.google.gms:google-services:3.0.0'}Gradle (app-level):apply plugin: 'com.google.gms.google-services'dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.firebase:firebase-ads:9.2.0'}Logcat (regarding ads):I/Ads: Starting ad request.W/Ads: Failed to load ad: 3 解决方案 This issue has been resolved through Vungle Android SDK 4.0.2 and Vungle AdMob Adopter 2.0.0https://v.vungle.com/sdkhttps://support.vungle.com/hc/en-us/articles/207604108 这篇关于RewardedVideoAd-带Vungle的AdMob中介-错误代码:3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-06 21:19