Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2730,7 +2730,7 @@
"groupId": "com.google.android.gms",
"artifactId": "play-services-ads",
"version": "25.4.0",
"nugetVersion": "125.4.0.1",
"nugetVersion": "125.4.0.2",
"nugetId": "Xamarin.GooglePlayServices.Ads",
"allowPrereleaseDependencies": true,
"extraDependencies": "androidx.lifecycle.lifecycle-livedata-core,androidx.lifecycle.lifecycle-runtime",
Expand All @@ -2740,7 +2740,7 @@
"groupId": "com.google.android.gms",
"artifactId": "play-services-ads-api",
"version": "25.4.0",
"nugetVersion": "125.4.0.1",
"nugetVersion": "125.4.0.2",
"nugetId": "Xamarin.GooglePlayServices.Ads.Api",
"type": "xbd"
},
Expand All @@ -2764,7 +2764,7 @@
"groupId": "com.google.android.gms",
"artifactId": "play-services-ads-lite",
"version": "24.0.0",
"nugetVersion": "124.0.0.6",
"nugetVersion": "124.0.0.7",
"nugetId": "Xamarin.GooglePlayServices.Ads.Lite",
"frozen": true,
"extraDependencies": "androidx.lifecycle.lifecycle-livedata-core,androidx.lifecycle.lifecycle-runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,17 @@ Google.Android.Gms.Ads.Initialization.IOnInitializationCompleteListener.OnInitia
Google.Android.Gms.Ads.Initialization.InitializationCompleteEventArgs
Google.Android.Gms.Ads.Initialization.InitializationCompleteEventArgs.InitializationCompleteEventArgs(Google.Android.Gms.Ads.Initialization.IInitializationStatus! p0) -> void
Google.Android.Gms.Ads.Initialization.InitializationCompleteEventArgs.P0.get -> Google.Android.Gms.Ads.Initialization.IInitializationStatus!
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpDeepLinkServiceWrapper
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpDeepLinkServiceWrapper.EndSession(Android.Gms.Dynamic.IObjectWrapper! p0, string! p1) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpDeepLinkServiceWrapper.Open(Android.Gms.Dynamic.IObjectWrapper! p0, string! p1, string! p2, Android.OS.Bundle! p3, bool p4, Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpServiceCallback! p5) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpDeepLinkServiceWrapper.Prewarm(Android.Gms.Dynamic.IObjectWrapper! p0, System.Collections.Generic.IList<Android.OS.Bundle!>! p1, Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpPrewarmServiceCallback! p2) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpPrewarmServiceCallback
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpPrewarmServiceCallback.OnError(Android.OS.Bundle! p0) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpPrewarmServiceCallback.OnPrewarmCompleted(Android.OS.Bundle! p0) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpServiceCallback
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpServiceCallback.OnDismissed(Android.OS.Bundle! p0) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpServiceCallback.OnError(Android.OS.Bundle! p0) -> void
Google.Android.Gms.Ads.Internal.Client.Hsdp.IHsdpServiceCallback.OnShown(Android.OS.Bundle! p0) -> void
Google.Android.Gms.Ads.Internal.Offline.Buffering.OfflineNotificationPoster
Google.Android.Gms.Ads.Internal.Offline.Buffering.OfflineNotificationPoster.OfflineNotificationPoster(Android.Content.Context! context, AndroidX.Work.WorkerParameters! params) -> void
Google.Android.Gms.Ads.Internal.Offline.Buffering.OfflineNotificationPoster.OfflineNotificationPoster(nint javaReference, Android.Runtime.JniHandleOwnership transfer) -> void
Expand Down Expand Up @@ -1375,6 +1386,7 @@ virtual Google.Android.Gms.Ads.AdLoader.IsLoading.get -> bool
virtual Google.Android.Gms.Ads.AdLoader.LoadAd(Google.Android.Gms.Ads.AdManager.AdManagerAdRequest! adManagerAdRequest) -> void
virtual Google.Android.Gms.Ads.AdLoader.LoadAd(Google.Android.Gms.Ads.AdRequest! adRequest) -> void
virtual Google.Android.Gms.Ads.AdLoader.LoadAds(Google.Android.Gms.Ads.AdRequest! adRequest, int maxNumberOfAds) -> void
virtual Google.Android.Gms.Ads.AdManager.AdManagerInterstitialAdLoadCallback.OnAdLoaded(Google.Android.Gms.Ads.AdManager.AdManagerInterstitialAd! p0) -> void
virtual Google.Android.Gms.Ads.AdRequest.AdString.get -> string?
virtual Google.Android.Gms.Ads.AdRequest.Builder.Build() -> Google.Android.Gms.Ads.AdRequest!
virtual Google.Android.Gms.Ads.AdRequest.Builder.Self() -> Google.Android.Gms.Ads.AdRequest.Builder!
Expand All @@ -1387,6 +1399,7 @@ virtual Google.Android.Gms.Ads.AdRequest.Keywords.get -> System.Collections.Gene
virtual Google.Android.Gms.Ads.AdRequest.NeighboringContentUrls.get -> System.Collections.Generic.IList<string!>!
virtual Google.Android.Gms.Ads.AdRequest.PlacementId.get -> long
virtual Google.Android.Gms.Ads.AdRequest.RequestAgent.get -> string!
virtual Google.Android.Gms.Ads.AppOpen.AppOpenAd.AppOpenAdLoadCallback.OnAdLoaded(Google.Android.Gms.Ads.AppOpen.AppOpenAd! p0) -> void
virtual Google.Android.Gms.Ads.BaseAdView.AdListener.get -> Google.Android.Gms.Ads.AdListener!
virtual Google.Android.Gms.Ads.BaseAdView.AdListener.set -> void
virtual Google.Android.Gms.Ads.BaseAdView.AdSize.get -> Google.Android.Gms.Ads.AdSize?
Expand All @@ -1412,6 +1425,7 @@ virtual Google.Android.Gms.Ads.FullScreenContentCallback.OnAdDismissedFullScreen
virtual Google.Android.Gms.Ads.FullScreenContentCallback.OnAdFailedToShowFullScreenContent(Google.Android.Gms.Ads.AdError! p0) -> void
virtual Google.Android.Gms.Ads.FullScreenContentCallback.OnAdImpression() -> void
virtual Google.Android.Gms.Ads.FullScreenContentCallback.OnAdShowedFullScreenContent() -> void
virtual Google.Android.Gms.Ads.Interstitial.InterstitialAdLoadCallback.OnAdLoaded(Google.Android.Gms.Ads.Interstitial.InterstitialAd! p0) -> void
virtual Google.Android.Gms.Ads.Mediation.Adapter.LoadAppOpenAd(Google.Android.Gms.Ads.Mediation.MediationAppOpenAdConfiguration! p0, Google.Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
virtual Google.Android.Gms.Ads.Mediation.Adapter.LoadBannerAd(Google.Android.Gms.Ads.Mediation.MediationBannerAdConfiguration! p0, Google.Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
virtual Google.Android.Gms.Ads.Mediation.Adapter.LoadInterstitialAd(Google.Android.Gms.Ads.Mediation.MediationInterstitialAdConfiguration! p0, Google.Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
Expand Down Expand Up @@ -1503,8 +1517,10 @@ virtual Google.Android.Gms.Ads.RequestConfiguration.TagForChildDirectedTreatment
virtual Google.Android.Gms.Ads.RequestConfiguration.TagForUnderAgeOfConsent.get -> int
virtual Google.Android.Gms.Ads.RequestConfiguration.TestDeviceIds.get -> System.Collections.Generic.IList<string!>!
virtual Google.Android.Gms.Ads.RequestConfiguration.ToBuilder() -> Google.Android.Gms.Ads.RequestConfiguration.Builder!
virtual Google.Android.Gms.Ads.Rewarded.RewardedAdLoadCallback.OnAdLoaded(Google.Android.Gms.Ads.Rewarded.RewardedAd! p0) -> void
virtual Google.Android.Gms.Ads.Rewarded.ServerSideVerificationOptions.CustomData.get -> string!
virtual Google.Android.Gms.Ads.Rewarded.ServerSideVerificationOptions.UserId.get -> string!
virtual Google.Android.Gms.Ads.RewardedInterstitial.RewardedInterstitialAdLoadCallback.OnAdLoaded(Google.Android.Gms.Ads.RewardedInterstitial.RewardedInterstitialAd! p0) -> void
virtual Google.Android.Gms.Ads.VersionInfo.MajorVersion.get -> int
virtual Google.Android.Gms.Ads.VersionInfo.MicroVersion.get -> int
virtual Google.Android.Gms.Ads.VersionInfo.MinorVersion.get -> int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,63 @@
OnAdFailedToLoadWithErrorCode
</attr>

<!--
Java-generics erasure fix for AdLoadCallback<AdT> subclasses (issue #1491).

The base class:
public abstract class AdLoadCallback<AdT> {
public void onAdLoaded(AdT ad) { }
}
only declares the erased onAdLoaded(Object) in bytecode, so the binding
generator exposes it as `virtual OnAdLoaded(Java.Lang.Object p0)` on every
concrete subclass (AdManagerInterstitialAdLoadCallback,
InterstitialAdLoadCallback, etc.).

When a user overrides that in C#, the generated Java ACW stub emits
`public void onAdLoaded(java.lang.Object p0)`. From javac's point of view
the parent (after generic substitution) declares
`onAdLoaded(AdManagerInterstitialAd)`, and the two methods have the same
erasure but neither overrides the other; javac reports a name-clash and
the app fails to build.

Fix: for each concrete subclass, add a specialized onAdLoaded(SpecificAd)
method via add-node. That surfaces a properly-typed
`virtual OnAdLoaded(SpecificAd p0)` in C# with a specialized JNI
registration, so users' ACW stubs emit the specialized signature that
correctly overrides the parent.

Note: play-services-ads-lite also ships bindings for the same types
(under the Android.Gms.Ads.* namespace); the equivalent fix lives in
that project's Metadata.xml.
-->
<add-node path="/api/package[@name='com.google.android.gms.ads.admanager']/class[@name='AdManagerInterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/admanager/AdManagerInterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.admanager.AdManagerInterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.interstitial']/class[@name='InterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/interstitial/InterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.interstitial.InterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.rewarded']/class[@name='RewardedAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/rewarded/RewardedAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.rewarded.RewardedAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.rewardedinterstitial']/class[@name='RewardedInterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/rewardedinterstitial/RewardedInterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.appopen']/class[@name='AppOpenAd.AppOpenAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/appopen/AppOpenAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.appopen.AppOpenAd" not-null="true"></parameter>
</method>
</add-node>

</metadata>
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@ virtual Android.Gms.Ads.AdLoader.IsLoading.get -> bool
virtual Android.Gms.Ads.AdLoader.LoadAd(Android.Gms.Ads.AdManager.AdManagerAdRequest! adManagerAdRequest) -> void
virtual Android.Gms.Ads.AdLoader.LoadAd(Android.Gms.Ads.AdRequest! adRequest) -> void
virtual Android.Gms.Ads.AdLoader.LoadAds(Android.Gms.Ads.AdRequest! adRequest, int maxNumberOfAds) -> void
virtual Android.Gms.Ads.AdManager.AdManagerInterstitialAdLoadCallback.OnAdLoaded(Android.Gms.Ads.AdManager.AdManagerInterstitialAd! p0) -> void
virtual Android.Gms.Ads.AdRequest.AdString.get -> string?
virtual Android.Gms.Ads.AdRequest.Builder.Build() -> Android.Gms.Ads.AdRequest!
virtual Android.Gms.Ads.AdRequest.ContentUrl.get -> string!
Expand All @@ -1346,6 +1347,7 @@ virtual Android.Gms.Ads.AdRequest.IsTestDevice(Android.Content.Context! context)
virtual Android.Gms.Ads.AdRequest.Keywords.get -> System.Collections.Generic.ICollection<string!>!
virtual Android.Gms.Ads.AdRequest.NeighboringContentUrls.get -> System.Collections.Generic.IList<string!>!
virtual Android.Gms.Ads.AdRequest.RequestAgent.get -> string!
virtual Android.Gms.Ads.AppOpen.AppOpenAd.AppOpenAdLoadCallback.OnAdLoaded(Android.Gms.Ads.AppOpen.AppOpenAd! p0) -> void
virtual Android.Gms.Ads.BaseAdView.AdListener.get -> Android.Gms.Ads.AdListener!
virtual Android.Gms.Ads.BaseAdView.AdListener.set -> void
virtual Android.Gms.Ads.BaseAdView.AdSize.get -> Android.Gms.Ads.AdSize?
Expand All @@ -1369,6 +1371,7 @@ virtual Android.Gms.Ads.FullScreenContentCallback.OnAdDismissedFullScreenContent
virtual Android.Gms.Ads.FullScreenContentCallback.OnAdFailedToShowFullScreenContent(Android.Gms.Ads.AdError! p0) -> void
virtual Android.Gms.Ads.FullScreenContentCallback.OnAdImpression() -> void
virtual Android.Gms.Ads.FullScreenContentCallback.OnAdShowedFullScreenContent() -> void
virtual Android.Gms.Ads.Interstitial.InterstitialAdLoadCallback.OnAdLoaded(Android.Gms.Ads.Interstitial.InterstitialAd! p0) -> void
virtual Android.Gms.Ads.Mediation.Adapter.LoadAppOpenAd(Android.Gms.Ads.Mediation.MediationAppOpenAdConfiguration! p0, Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
virtual Android.Gms.Ads.Mediation.Adapter.LoadBannerAd(Android.Gms.Ads.Mediation.MediationBannerAdConfiguration! p0, Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
virtual Android.Gms.Ads.Mediation.Adapter.LoadInterstitialAd(Android.Gms.Ads.Mediation.MediationInterstitialAdConfiguration! p0, Android.Gms.Ads.Mediation.IMediationAdLoadCallback! callback) -> void
Expand Down Expand Up @@ -1454,8 +1457,10 @@ virtual Android.Gms.Ads.RequestConfiguration.TagForChildDirectedTreatment.get ->
virtual Android.Gms.Ads.RequestConfiguration.TagForUnderAgeOfConsent.get -> int
virtual Android.Gms.Ads.RequestConfiguration.TestDeviceIds.get -> System.Collections.Generic.IList<string!>!
virtual Android.Gms.Ads.RequestConfiguration.ToBuilder() -> Android.Gms.Ads.RequestConfiguration.Builder!
virtual Android.Gms.Ads.Rewarded.RewardedAdLoadCallback.OnAdLoaded(Android.Gms.Ads.Rewarded.RewardedAd! p0) -> void
virtual Android.Gms.Ads.Rewarded.ServerSideVerificationOptions.CustomData.get -> string!
virtual Android.Gms.Ads.Rewarded.ServerSideVerificationOptions.UserId.get -> string!
virtual Android.Gms.Ads.RewardedInterstitial.RewardedInterstitialAdLoadCallback.OnAdLoaded(Android.Gms.Ads.RewardedInterstitial.RewardedInterstitialAd! p0) -> void
virtual Android.Gms.Ads.VersionInfo.MajorVersion.get -> int
virtual Android.Gms.Ads.VersionInfo.MicroVersion.get -> int
virtual Android.Gms.Ads.VersionInfo.MinorVersion.get -> int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,62 @@
<parameter name="bundle" type="android.os.Bundle"></parameter>
</method>
</add-node>

<!--
Java-generics erasure fix for AdLoadCallback<AdT> subclasses (issue #1491).

The base class:
public abstract class AdLoadCallback<AdT> {
public void onAdLoaded(AdT ad) { }
}
only declares the erased `onAdLoaded(Object)` in bytecode, so the binding
generator exposes it as `virtual OnAdLoaded(Java.Lang.Object p0)` on every
concrete subclass (AdManagerInterstitialAdLoadCallback, InterstitialAdLoadCallback,
etc.).

When a user overrides that in C#, the generated Java ACW stub emits
`public void onAdLoaded(java.lang.Object p0)`. From javac's point of view
the parent (after generic substitution) declares
`onAdLoaded(AdManagerInterstitialAd)`, and the two methods have the same
erasure but neither overrides the other — javac reports a name-clash and
the app fails to build.

Fix: for each concrete subclass, add a specialized `onAdLoaded(SpecificAd)`
method via <add-node>. That surfaces a properly-typed
`virtual OnAdLoaded(SpecificAd p0)` in C# with a specialized JNI
registration, so users' ACW stubs emit the specialized signature that
correctly overrides the parent. This matches how Google's own docs show
the callback being overridden in Java.
-->
<add-node path="/api/package[@name='com.google.android.gms.ads.admanager']/class[@name='AdManagerInterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/admanager/AdManagerInterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.admanager.AdManagerInterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.interstitial']/class[@name='InterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/interstitial/InterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.interstitial.InterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.rewarded']/class[@name='RewardedAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/rewarded/RewardedAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.rewarded.RewardedAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.rewardedinterstitial']/class[@name='RewardedInterstitialAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/rewardedinterstitial/RewardedInterstitialAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.rewardedinterstitial.RewardedInterstitialAd" not-null="true"></parameter>
</method>
</add-node>

<add-node path="/api/package[@name='com.google.android.gms.ads.appopen']/class[@name='AppOpenAd.AppOpenAdLoadCallback']">
<method abstract="false" deprecated="not deprecated" final="false" name="onAdLoaded" native="false" return="void" static="false" synchronized="false" visibility="public" bridge="false" synthetic="false" jni-signature="(Lcom/google/android/gms/ads/appopen/AppOpenAd;)V" jni-return="V">
<parameter name="p0" type="com.google.android.gms.ads.appopen.AppOpenAd" not-null="true"></parameter>
</method>
</add-node>


<attr
Expand Down