Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Error after updating google ads to 121.0.0.0 (same thing from version 120.6.0 and 120.6.1) #654

Open
vsfeedback opened this issue Jul 11, 2022 · 5 comments

Comments

@vsfeedback
Copy link

vsfeedback commented Jul 11, 2022

This issue has been moved from a ticket on Developer Community.


I'm getting this error after updating google ads to the last three versions available in nuget

{Java.Lang.IncompatibleClassChangeError: The method 'java.lang.Class java.lang.Object.getClass()'
 was expected to be of type interface but instead was found to be of type virtual (declaration of 
 'com.google.android.gms.dynamic.ObjectWrapper' appears in /data/app/com.nkkinsoft.jobmag-1/base.apk)
  at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00068] in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11884 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00024] in /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:29 
  at Android.Gms.Ads.BaseAdView.LoadAd (Android.Gms.Ads.AdRequest adRequest) [0x00027] in C:\a\_work\1\s\generated\com.google.android.gms.play-services-ads-lite\obj\Release\monoandroid12.0\generated\src\Android.Gms.Ads.BaseAdView.cs:498 
  at Wordpress.Adapters.RecycleAdapter.FillHorizontalCrads (System.IDisposable holder, System.Int32 position) [0x000e8] in D:\Nkkin\xamarin\Bloggers\Job Mag\Wordpress\Adapters\RecycleAdapter.cs:339 
  --- End of managed Java.Lang.IncompatibleClassChangeError stack trace ---
java.lang.IncompatibleClassChangeError: The method 'java.lang.Class java.lang.Object.getClass()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'com.google.android.gms.dynamic.ObjectWrapper' appears in /data/app/com.nkkinsoft.jobmag-1/base.apk)
	at com.google.android.gms.dynamic.ObjectWrapper.unwrap(com.google.android.gms:play-services-basement@@18.0.2:4)
	at com.google.android.gms.ads.internal.client.zzdu.zzm(com.google.android.gms:play-services-ads-lite@@21.0.0:23)
	at com.google.android.gms.ads.BaseAdView.loadAd(com.google.android.gms:play-services-ads-lite@@21.0.0:5)
	at mono.java.lang.RunnableImplementor.n_run(Native Method)
	at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
	at android.os.Handler.handleCallback(Handler.java:751)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6176)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
}

Original Comments

Feedback Bot on 6/30/2022, 07:38 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dmariogatto
Copy link

Still an issue on the latest version 121.0.0.1. Possibly related to #637.

@jvreeker
Copy link

I had also these problems, so I rolled back.

@jonathanantoine
Copy link

Same problem for me, it happens only on Samsung devices (Galaxy S9 for instance) as far as I know.

@AntRemo
Copy link

AntRemo commented Dec 19, 2022

Hi @dmariogatto, @jvreeker @jonathanantoine

Where is this error occurring for you? (ex: emulator, test devices, production)

I just updated my project (121.2.0 Ads.Lite) and was able to build + run on emulator. Curious if my configuration resolves this issue.

Many thanks! 🙏

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants