I have this error in Unity.It shows the piece of code where i added my banner.And piece of code is simply normal like it is shown on official google page;
private void RequestBanner()
{
// Clean up banner before reusing
if (bannerView != null)
{
bannerView.Destroy();
}
this.bannerView = new BannerView(BannerID, AdSize.Banner,AdPosition.Bottom);
AdRequest request = new AdRequest.Builder().Build();
bannerView.LoadAd(request); // <-- Warning thrown HERE
bannerView.Show();
// bannerView.Destroy();
}
You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all
UnityEngine.MonoBehaviour:.ctor()
ButtonBehaviour:.ctor()
GoogleMobileAds.Unity.BannerClient:CreateButtonBehavior() (at Assets/GoogleMobileAds/Platforms/Unity/BannerClient.cs:64)
GoogleMobileAds.Unity.BannerClient:ShowBannerView() (at Assets/GoogleMobileAds/Platforms/Unity/BannerClient.cs:143)
GoogleMobileAds.Unity.BannerClient:LoadAd(AdRequest) (at Assets/GoogleMobileAds/Platforms/Unity/BannerClient.cs:123)
GoogleMobileAds.Api.BannerView:LoadAd(AdRequest) (at Assets/GoogleMobileAds/Api/BannerView.cs:61)
Admanager:RequestBanner() (at Assets/Scripts/Admanager.cs:115)
Admanager:Start() (at Assets/Scripts/Admanager.cs:63)