私はXamarinプロジェクトでAdMobを使用しようとしています。私は自分のアプリに報酬を与えられたビデオを表示することを目指しています。私は解決できない問題があり、あなたと共有したいと思います。私はいつものプロジェクトを実行Xamarin Admob RewardedVideoAdコードエラー0&3
- Xamarinのv4.0.1.96
- XamarinのAndroid v6.0.1.10
- Xamarin.GooglePlayServices.Ads v27.0.0
:ここに私の環境であり、実際のデバイス。問題がデバッグ環境から発生した場合、私はストアにアプリケーションを公開しました。ローカルと同じ問題が発生しました。
using System;
using Android.OS;
using Android.Views;
using Android.Gms.Ads;
public class ReloadCreditActivity : AppCompatActivityBase, IRewardedVideoAdListener
{
public IRewardedVideoAd RewardedVideoAd { get; set; }
public Button DisplayVideoButton { get; set; }
private static string AD_UNIT_ID = "ca-app-pub-XXXXXXXXXXXXXX25/XXXXXXXX99";
private bool _isRewardedVideoLoading;
private static object _lock = new object();
protected IRewardedVideoAd _rewardedVideoAd;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.ReloadCreditLayout);
DisplayVideoButton = FindViewById<Button>(Resource.Id.tabCreditFreemieum_DisplayVideo);
RewardedVideoAd = MobileAds.GetRewardedVideoAdInstance(this);
RewardedVideoAd.RewardedVideoAdListener = this;
LoadRewardedVideoAd();
DisplayVideoButton.Click += (o, e) =>
{
ShowRewardedVideo();
};
}
public void LoadRewardedVideoAd()
{
lock (_lock)
{
if (!_isRewardedVideoLoading && !RewardedVideoAd.IsLoaded)
{
_isRewardedVideoLoading = true;
Bundle extras = new Bundle();
extras.PutBoolean("_noRefresh", true);
var adMobAdapter = new AdMobAdapter();
AdRequest adRequest = new AdRequest.Builder()
//.AddTestDevice(AdRequest.DeviceIdEmulator)
//.AddTestDevice("FE5692B3DAD1B4CE3BE3BDA2FF4B6103")
//.AddNetworkExtrasBundle(adMobAdapter.Class, extras)
.Build();
RewardedVideoAd.UserId = "pub-74XXXXXXXXXXXXXX";
RewardedVideoAd.LoadAd(AD_UNIT_ID, adRequest);
}
}
}
public void ShowRewardedVideo()
{
if (RewardedVideoAd.IsLoaded)
{
RewardedVideoAd.Show();
}
}
public void OnRewarded(IRewardItem reward)
{
Toast.MakeText(this, string.Format("OnRewarded ! currency: {0} amount: {1}", reward.GetType(), reward.Amount), ToastLength.Short).Show();
}
public void OnRewardedVideoAdClosed()
{
Toast.MakeText(this, "OnRewardedVideoAdClosed", ToastLength.Short).Show();
LoadRewardedVideoAd();
}
public void OnRewardedVideoAdFailedToLoad(int errorCode)
{
lock (_lock)
{
_isRewardedVideoLoading = false;
}
Toast.MakeText(this, "OnRewardedVideoAdFailedToLoad Code error : " + errorCode, ToastLength.Short).Show();
}
public void OnRewardedVideoAdLeftApplication()
{
Toast.MakeText(this, "OnRewardedVideoAdLeftApplication", ToastLength.Short).Show();
}
public void OnRewardedVideoAdLoaded()
{
lock (_lock)
{
_isRewardedVideoLoading = false;
}
Toast.MakeText(this, "OnRewardedVideoAdLoaded", ToastLength.Short).Show();
}
public void OnRewardedVideoAdOpened()
{
Toast.MakeText(this, "OnRewardedVideoAdOpened", ToastLength.Short).Show();
}
public void OnRewardedVideoStarted()
{
Toast.MakeText(this, "OnRewardedVideoStarted", ToastLength.Short).Show();
}
}
私はこのページに移動すると、アプリが常にOnRewardedVideoAdFailedToLoad()コールバックを上げます。私は、エラーコード0を取得するために使用されるが、現在、私は、エラーコード3
私は多分それはと私のAdMobの構成上の問題であることを自分自身に言った
05-10 11:45:31.600 I/Ads (14764): Starting ad request.
05-10 11:45:31.600 I/Ads (14764): Use AdRequest.Builder.addTestDevice("FE5692B3DAD1B4CE3BE3BDA2FF4B6103") to get test ads on this device.
...
05-10 11:45:31.910 W/Ads (14764): Could not instantiate mediation adapter: com.jirbo.adcolony.AdColonyAdapter. com.jirbo.adcolony.AdColonyAdapter
05-10 11:45:31.910 W/Ads (14764): Fail to instantiate adapter com.jirbo.adcolony.AdColonyAdapter
05-10 11:45:31.910 W/Ads (14764): android.os.RemoteException
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzag(Unknown Source)
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzae(Unknown Source)
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzem$zza.onTransact(Unknown Source)
...
05-10 11:45:31.910 W/Ads (14764): Could not instantiate mediation adapter: com.fuse.mediation.FuseAdapter. com.fuse.mediation.FuseAdapter
05-10 11:45:31.910 W/Ads (14764): Fail to instantiate adapter com.fuse.mediation.FuseAdapter
05-10 11:45:31.910 W/Ads (14764): android.os.RemoteException
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzag(Unknown Source)
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzae(Unknown Source)
...
05-10 11:45:31.910 W/Ads (14764): Could not instantiate mediation adapter: com.google.ads.mediation.chartboost.ChartboostAdapter. com.google.ads.mediation.chartboost.ChartboostAdapter
05-10 11:45:31.910 W/Ads (14764): Fail to instantiate adapter com.google.ads.mediation.chartboost.ChartboostAdapter
05-10 11:45:31.910 W/Ads (14764): android.os.RemoteException
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzag(Unknown Source)
05-10 11:45:31.910 W/Ads (14764): at com.google.android.gms.internal.zzel.zzae(Unknown Source)
...
05-10 11:45:31.920 W/Ads (14764): Could not instantiate mediation adapter: com.google.ads.mediation.unity.UnityAdapter. com.google.ads.mediation.unity.UnityAdapter
05-10 11:45:31.920 W/Ads (14764): Fail to instantiate adapter com.google.ads.mediation.unity.UnityAdapter
05-10 11:45:31.920 W/Ads (14764): android.os.RemoteException
05-10 11:45:31.920 W/Ads (14764): at com.google.android.gms.internal.zzel.zzag(Unknown Source)
05-10 11:45:31.920 W/Ads (14764): at com.google.android.gms.internal.zzel.zzae(Unknown Source)
...
05-10 11:45:31.920 W/Ads (14764): Could not instantiate mediation adapter: com.vungle.mediation.VungleAdapter. com.vungle.mediation.VungleAdapter
05-10 11:45:31.920 W/Ads (14764): Fail to instantiate adapter com.vungle.mediation.VungleAdapter
05-10 11:45:31.920 W/Ads (14764): android.os.RemoteException
05-10 11:45:31.920 W/Ads (14764): at com.google.android.gms.internal.zzel.zzag(Unknown Source)
05-10 11:45:31.920 W/Ads (14764): at com.google.android.gms.internal.zzel.zzae(Unknown Source)
...
05-10 11:45:31.920 W/Ads (14764): Failed to load ad: 3
Androidデバイスのログでエラーをチェックしましたので、ここで、広告主は、私の設定です:
たぶん私はので、ここで、広告主の設定に間違った何かをした私の広告主です。
してください、私にあなたのフィードバックを与えます。 ありがとうございました。
コメントがありません。 – user1842258