- Home /
Unity & GoogleMobAds integration warning cause a problem.
Dear All,
I've developed a game, it's in early phase, I'm trying it deploying at google play store.
I'm trying to integrate google mob ads according to this document:
https://developers.google.com/admob/unity/interstitial
When I run the game in Unity editor, it works fine, but raising a warning error as:
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.InterstitialClient:CreateButtonBehavior () GoogleMobileAds.Unity.InterstitialClient:Show () GoogleMobileAds.Api.InterstitialAd:Show () MainScript:GetJoker () (at Assets/Scripts/MainScript.cs:977) UnityEngine.EventSystems.EventSystem:Update ()
I am using Unity: 2020.3.31f1
I've installed GoogleMobAds v7, v6. and v5. but the problem exists for all them.
I build it google play with this warning case, but it does not work. I mean none of funstions were normal as work in Unity editor. I think this warning is a big problem, but so far, I could not find any solution to discard this warning message.
Can you have any suggestion to find a solution?
Thanks and regards.