When press Play button on unity editor, at first time request a banner ads, warning show in console.
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)
private BannerView bannerView;
this.bannerView.LoadAd();
The problem at the line buttonBehaviour = new ButtonBehaviour();
in CreateButtonBehavior function
in AssetsGoogleMobileAdsPlatformsUnityBannerClient.cs
I replaced this line buttonBehaviour = new ButtonBehaviour();
with lines:
GameObject ob=new GameObject();
ob.AddComponent
buttonBehaviour = ob.GetComponent
And warnings gone.
Hope to help someone like me.
First huge problems with the Firebase plugins, had to downgrade to a months old version to work, now we are forced to upgrade due to IOS 14 and they new a MonoBehaviour right in the main code... This is absurd, why can't google with all their billions hire a developer for this widely use plugin they make money out of?
I replaced it with "GameObject go = new GameObject();
buttonBehaviour = go.AddComponent<ButtonBehaviour>();"
and it works
and error gone.
Is there any reliable fork (with relavent release package) that includes this fix? Just because of this, the official releases are unusable for me and I do not understand how they are usable for others.
(I recommend changing the subject of this issue as it is not just related to v5.4.0.)
don't worry about that don't change anything, It's just a warning and
that's too only for showing ad templates in unity. I didn't change a thing
and the ads working on my games fine.
Peace...
On Mon, May 24, 2021 at 5:29 PM CharlieReece @.*>
wrote:
(I recommend changing the subject of this issue as it is not just related
to v5.4.0.)—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/googleads/googleads-mobile-unity/issues/1585#issuecomment-846994052,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALQ5QR4EH7FNL4VNQYLFOQLTPI5QXANCNFSM4ZY4KJ6A
.
don't worry about that don't change anything, It's just a warning and that's too only for showing ad templates in unity. I didn't change a thing and the ads working on my games fine. Peace...
Thank you for sharing your experience, it is nice to know it does not break anything; but, the problem is it is the only warning in my console. I have been working with zero warning policy. (warning = error)
yeah... me too.. That's why I tried some 2 line program to get rid of that
error and I did get rid of that error. With or without it the Ad serving
will be fine. If you want those two lines... let me know...
On Mon, May 24, 2021 at 5:42 PM CharlieReece @.*>
wrote:
don't worry about that don't change anything, It's just a warning and
that's too only for showing ad templates in unity. I didn't change a thing
and the ads working on my games fine. Peace...
… <#m_-2411447575647925069_>
On Mon, May 24, 2021 at 5:29 PM CharlieReece @.*> wrote: (I recommend
changing the subject of this issue as it is not just related to v5.4.0.) —
You are receiving this because you commented. Reply to this email directly,
view it on GitHub <#1585 (comment)
https://github.com/googleads/googleads-mobile-unity/issues/1585#issuecomment-846994052>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALQ5QR4EH7FNL4VNQYLFOQLTPI5QXANCNFSM4ZY4KJ6A
.Thank you for sharing your experience, it is nice to know it does not
break anything; but, the problem is it is the only warning in my console. I
have been working with zero warning policy. (warning = error)—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/googleads/googleads-mobile-unity/issues/1585#issuecomment-847001057,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALQ5QR4T2V3NXV6PLFDTS6DTPI7DFANCNFSM4ZY4KJ6A
.
yeah... me too.. That's why I tried some 2 line program to get rid of that error and I did get rid of that error. With or without it the Ad serving will be fine. If you want those two lines... let me know...
Thank you, I used your fix (taken from above). I downloaded the release package, deleted Assets > GoogleMobileAds > "GoogleMobileAds.Unity" and instead, I used the source code of the Unity plugin directory located in this repository. Then, I applied your fix.
This is ugly as I broke maintainability but I had to. I hope this is fixed by the maintainers soon so it can be included in the official release package.
Okay.. All the Best to you...
On Mon, May 24, 2021 at 9:24 PM CharlieReece @.*>
wrote:
yeah... me too.. That's why I tried some 2 line program to get rid of that
error and I did get rid of that error. With or without it the Ad serving
will be fine. If you want those two lines... let me know...Thank you, I used your fix (taken from above). I downloaded the release
package, deleted Assets > GoogleMobileAds > "GoogleMobileAds.Unity" and
instead, I used the source code of the Unity plugin directory located in
this repository. Then, I applied your fix.This is ugly as I broke maintainability but I had to. I hope this is fixed
by the maintainers soon so it can be included in the official release
package.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/googleads/googleads-mobile-unity/issues/1585#issuecomment-847143209,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALQ5QR76HKMW4JFIEF4GQE3TPJZDLANCNFSM4ZY4KJ6A
.
This issue persists in the very latest version of the library. Is this going to be fixed?
In the final version the plugin contains only dlls and now I can't change the code myself to fix this problem. Why is this taking so long to fix, some fixes were already suggested in this thread alone?
Most helpful comment
First huge problems with the Firebase plugins, had to downgrade to a months old version to work, now we are forced to upgrade due to IOS 14 and they new a MonoBehaviour right in the main code... This is absurd, why can't google with all their billions hire a developer for this widely use plugin they make money out of?