Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeCustomFormatAd and related types missing from Ads/Ads.Lite #798

Open
jump32 opened this issue Aug 8, 2023 · 10 comments
Open

NativeCustomFormatAd and related types missing from Ads/Ads.Lite #798

jump32 opened this issue Aug 8, 2023 · 10 comments
Assignees
Labels
in-progress Work is in progress needs-info More information is requested by engineering

Comments

@jump32
Copy link

jump32 commented Aug 8, 2023

Google Play Services Version

  • Xamarin.GooglePlayServices.Ads (version 121.3.0 onwards)

  • Xamarin.GooglePlayServices.Ads.Lite (version 121.3.0 onwards)

Describe your Issue

Between version 121.2.0 and version 121.3.0 there are a number of interfaces and classes that have gone missing. As far as I can tell they still exist in the original Google SDKs.

The missing definitions are:

  • INativecustomFormatAdExtensions
  • NativeCustomFormatAd
  • NativeCustomFormatAdConstants
  • INativeCustomFormatAd
  • (others relating to NativeCustomFormatAd)

Relevant information

You can compare https://www.fuget.org/packages/Xamarin.GooglePlayServices.Ads.Lite/121.2.0/lib/net6.0-android31.0/Xamarin.GooglePlayServices.Ads.Lite.dll/Android.Gms.Ads.NativeAd

and https://www.fuget.org/packages/Xamarin.GooglePlayServices.Ads.Lite/121.3.0/lib/net6.0-android31.0/Xamarin.GooglePlayServices.Ads.Lite.dll/Android.Gms.Ads.NativeAd

Under the Android.Gms.Ads.NativeAd namespace you can see the missing interfaces.

Steps to Reproduce (with link to sample solution if possible):

Download and build https://github.com/jump32/ads-test (should build ok)
Update Xamarin.GooglePlayServices.Ads.Lite to 121.3.0 or greater
Rebuild (should fail with unknown type)

@mhdwaelanjo
Copy link

I fixed the problem.. we can use my libraries :

 <PackageReference Include="Anjo.Android.GoogleServices.Ads" Version="22.0.0" />
 <PackageReference Include="Anjo.Android.GoogleServices.AdsBase" Version="22.0.0" />
 <PackageReference Include="Anjo.Android.GoogleServices.AdsLite" Version="22.0.0" />

Supports fixing the problem of Loading ads using :

  • Let's rename for Interstitial ads InterstitialAdLoadCallback to AnjoInterstitialLoadCallback.
  • Let's rename for Rewarded ads RewardedAdLoadCallback to AnjoRewardedLoadCallback.
  • Let's rename for App Open Ads AppOpenAd.AppOpenAdLoadCallback to AnjoAppOpenLoadCallback.
  • Let's rename for Rewarded interstitial ads RewardedInterstitialAdLoadCallback to AnjoRewardedInterstitialLoadCallback.

@jump32
Copy link
Author

jump32 commented Aug 15, 2023

I'd prefer the original packages to be fixed.

@moljac
Copy link
Member

moljac commented Aug 27, 2023

Investigating namespace Android.Gms.Ads.NativeAd (package package)

Version 21.2.0:

jar tvf ./play-services-ads-lite-21.2.0.aar/classes.jar | grep "com/google/android/gms/ads/nativead/"

results:

 1259 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/AdChoicesView.class
  2571 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/MediaView.class
   797 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$AdChoicesInfo.class
   646 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$Image.class
   469 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$OnNativeAdLoadedListener.class
   495 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$UnconfirmedClickListener.class
  2659 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAd.class
   963 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdAssetNames.class
   347 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$AdChoicesPlacement.class
  2825 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$Builder.class
   355 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$NativeMediaAspectRatio.class
  2295 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions.class
 10410 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdView.class
  4102 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeAdViewHolder.class
   475 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$DisplayOpenMeasurement.class
   520 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomClickListener.class
   523 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomFormatAdLoadedListener.class
  1763 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd.class
   369 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/zzb.class
   369 Tue Aug 30 09:29:28 CEST 2022 com/google/android/gms/ads/nativead/zzc.class

Version 21.3.0:

jar tvf ./play-services-ads-lite-21.3.0.aar/classes.jar | grep "com/google/android/gms/ads/nativead/"

results:

  1259 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/AdChoicesView.class
  3390 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/MediaView.class
   797 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$AdChoicesInfo.class
   646 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$Image.class
   469 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$OnNativeAdLoadedListener.class
   495 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAd$UnconfirmedClickListener.class
  2659 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAd.class
   963 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdAssetNames.class
   347 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$AdChoicesPlacement.class
  2825 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$Builder.class
   355 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions$NativeMediaAspectRatio.class
  2295 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdOptions.class
 10410 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdView.class
  4102 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeAdViewHolder.class
   475 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$DisplayOpenMeasurement.class
   520 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomClickListener.class
   523 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomFormatAdLoadedListener.class
  1949 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/NativeCustomFormatAd.class
   369 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/zzb.class
   369 Wed Sep 14 12:43:36 CEST 2022 com/google/android/gms/ads/nativead/zzc.class

Version currently bound:

 jar tvf ./externals/com.google.android.gms/play-services-ads-lite/classes.jar | grep "com/google/android/gms/ads/nativead/"
  1259 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/AdChoicesView.class
  3537 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/MediaView.class
   797 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAd$AdChoicesInfo.class
   646 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAd$Image.class
   469 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAd$OnNativeAdLoadedListener.class
   495 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAd$UnconfirmedClickListener.class
  2779 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAd.class
   963 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdAssetNames.class
   347 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdOptions$AdChoicesPlacement.class
  3377 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdOptions$Builder.class
   355 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdOptions$NativeMediaAspectRatio.class
   353 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdOptions$SwipeGestureDirection.class
  2744 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdOptions.class
 10369 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdView.class
  4093 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeAdViewHolder.class
   475 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeCustomFormatAd$DisplayOpenMeasurement.class
   520 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomClickListener.class
   523 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeCustomFormatAd$OnCustomFormatAdLoadedListener.class
  1665 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/NativeCustomFormatAd.class
   369 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/zzb.class
   369 Tue Jul 18 14:48:48 CEST 2023 com/google/android/gms/ads/nativead/zzc.class

MCWs:

ll generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.*

results:

-rw-r--r--  1 user  wheel   7680 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.AdChoicesView.cs
-rw-r--r--  1 user  wheel   9573 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.MediaView.cs
-rw-r--r--  1 user  wheel  87761 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.NativeAd.cs
-rw-r--r--  1 user  wheel   5058 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.NativeAdAssetNames.cs
-rw-r--r--  1 user  wheel  42261 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.NativeAdOptions.cs
-rw-r--r--  1 user  wheel  30723 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.NativeAdView.cs
-rw-r--r--  1 user  wheel   6986 Aug 27 18:59 generated/com.google.android.gms.play-services-ads-lite/obj/Debug/monoandroid12.0/generated/src/Android.Gms.Ads.NativeAd.NativeAdViewHolder.cs

@moljac
Copy link
Member

moljac commented Aug 28, 2023

@jump32 Thanks for the feedback.

Can you please elaborate this:

As far as I can tell they still exist in the original Google SDKs.

The missing definitions are:

  • INativecustomFormatAdExtensions
  • NativeCustomFormatAd
  • NativeCustomFormatAdConstants
  • INativeCustomFormatAd
  • (others relating to NativeCustomFormatAd)

INativeCustomFormatAd is missing and I am investigating why, but I other types you mentioned are not available in both 21.2.0 and 21.3.0..

  • (others relating to NativeCustomFormatAd)

Which other related types would that be?

@moljac moljac self-assigned this Aug 28, 2023
@moljac moljac added needs-info More information is requested by engineering in-progress Work is in progress labels Aug 28, 2023
@jpobst
Copy link
Contributor

jpobst commented Aug 28, 2023

Mel's research from Discord:

obj/Debug/monoandroid12.0/api.xml(4354,6): warning BG8503: Invalidating
'Android.Gms.Ads.NativeAd.INativeCustomFormatAd' and all its nested types because some of its methods were invalid.
[./generated/com.google.android.gms.play-services-ads-lite/com.google.android.gms.play-services-ads-lite.csproj]

leads to

obj/Debug/monoandroid12.0/api.xml(4362,8): warning BG8701: Invalid return type 'com.google.android.gms.ads.MediaContent'
 for member 'Android.Gms.Ads.NativeAd.INativeCustomFormatAd.GetMediaContent ()'.
[./generated/com.google.android.gms.play-services-ads-lite/com.google.android.gms.play-services-ads-lite.csproj]

further MediaContent points to:

obj/Debug/monoandroid12.0/api.xml(685,6): warning BG8503: Invalidating 'Android.Gms.Ads.IMediaContent' and all its nested 
types because some of its methods were invalid. [./generated/com.google.android.gms.play-services-ads-
lite/com.google.android.gms.play-services-ads-lite.csproj]

and that leads to:

obj/Debug/monoandroid12.0/api.xml(695,8): warning BG8700: Unknown return type 
'com.google.android.gms.internal.ads.zzbff' for member 'Android.Gms.Ads.IMediaContent.Zza ()'. 
[./generated/com.google.android.gms.play-services-ads-lite/com.google.android.gms.play-services-ads-lite.csproj]

So, 2 interfaces were transitively removed because some obfuscated type has invalid return type.

@jump32
Copy link
Author

jump32 commented Aug 28, 2023

Hi @moljac

Having initially identified the issue, I was just comparing the fuget links I posted. So as far as I can see from those two links, the missing types are:

NativeCustomFormatAdOnCustomClickEventArgs
NativeCustomFormatAdOnCustomFormatAdLoadedEventArgs
INativeCustomFormatAdExtensions
NativeCustomFormatAd
NativeCustomFormatAdConsts
INativeCustomFormatAd
INativeCustomFormatAdDisplayOpenMeasurement
INativeCustomFormatAdOnCustomClickListener
INativeCustomFormatAdOnCustomFormatAdLoadedListener

Since they are all related to NativeCustomFormatAd, if you manage to restore that class I suspect the other will be restored as well.

@jump32
Copy link
Author

jump32 commented Oct 4, 2023

Hi @moljac Is there any progress on this?

@moljac
Copy link
Member

moljac commented Nov 6, 2023

No.Not yet.

@Picao84
Copy link

Picao84 commented Mar 5, 2024

It's been a few months now. Any fix soon?

@Picao84
Copy link

Picao84 commented Mar 22, 2024

I fixed the problem.. we can use my libraries :

 <PackageReference Include="Anjo.Android.GoogleServices.Ads" Version="22.0.0" />
 <PackageReference Include="Anjo.Android.GoogleServices.AdsBase" Version="22.0.0" />
 <PackageReference Include="Anjo.Android.GoogleServices.AdsLite" Version="22.0.0" />

Supports fixing the problem of Loading ads using :

  • Let's rename for Interstitial ads InterstitialAdLoadCallback to AnjoInterstitialLoadCallback.
  • Let's rename for Rewarded ads RewardedAdLoadCallback to AnjoRewardedLoadCallback.
  • Let's rename for App Open Ads AppOpenAd.AppOpenAdLoadCallback to AnjoAppOpenLoadCallback.
  • Let's rename for Rewarded interstitial ads RewardedInterstitialAdLoadCallback to AnjoRewardedInterstitialLoadCallback.

But you did not fix the problem? All the issues on this ticket are present on your nuget package, as there is no NativeCustomFormatAd, no MediaContent, etc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress Work is in progress needs-info More information is requested by engineering
Projects
None yet
Development

No branches or pull requests

5 participants