Call Initialize() assuming it will instantiate DummyClient in Editor as it did in previous version 5.0.1. But instead I've got an exception:
EntryPointNotFoundException: GADUInitializeWithCallback
GoogleMobileAds.iOS.MobileAdsClient.Initialize (System.Action`1[T] initCompleteAction) (at Assets/GoogleMobileAds/Platforms/iOS/MobileAdsClient.cs:53)
GoogleMobileAds.Api.MobileAds.Initialize (System.Action`1[T] initCompleteAction) (at Assets/GoogleMobileAds/Api/MobileAds.cs:64)
...
It points to this call in iOS/MobileAdsClient.cs:
Externs.GADUInitializeWithCallback(this.mobileAdsClientPtr, InitializationCompleteCallback);
Probably because wrong GoogleMobileAdsClientFactory instantiates wrong MobileAdsClient (for iOS one, not for Editor).
// Run in Windows Editor targeting iOS:
MobileAds.Initialize(HandleInitComplete);
I think that you'll find it is still creating a dummy client and that this is actually referring to an undefined method in the dll since when you select iOS as a target definitions such as this become active, and this method is not defined for Unity editor, only in the iOS plugin library.
Therefore as per https://github.com/googleads/googleads-mobile-unity/issues/1307 my suggestion is that you don't try and run in Unity Editor when targeting the iOS platform, switch the target platform to standalone or Android for example and it will not be an issue.
It's a clear regression, not a usage error. It was introduced probably when splitting out iOS-specific version of GoogleMobileAdsClientFactory with #if UNITY_IOS instead of correct #if UNITY_IOS && !UNITY_EDITOR, or something like that.
Calling from Editor of this public API should be gracefully handled in the library implementation, just as it was years before this regression was introduced month ago.
is that you don't try and run in Unity Editor
We are a team of tens of people working on cross-platform mobile game of millions installs. I just can't ask the half of developers sitting on macOS/iOS to stop running the game from the Editor.
Hey @stowy , @qbit86 is 100% correct, working on a different platform isn't an acceptable solution, it's just a workaround at-best... 馃槥
We do need to work on UNITY_IOS every now and then and must to be able to do so without getting an error from AdMob. It wasn't an issue until version 5.1.0 and I'm sure that you guys can quickly resolve it back to how it was before this version.
Could you please look into it? Or should we just stick with the older version 5.0.1 forever..?
I agree it is a regression since 5.0.1, I looked into this and found the cause. There is a fix pending.
That's so awesome to read @stowy , great job!!! :)
I also encountered this bug. After updating to Google Mobile Ads Unity Plugin v5.2.0 it's gone. Thanks.
Most helpful comment
I agree it is a regression since 5.0.1, I looked into this and found the cause. There is a fix pending.