Issue
I have in the past successfully implement the Google AdMob, but this time with a new project, it's impossible!
I have error with Google AdMob integration in a blank Xamarin.Forms project.
In the standard project :
Have theres Nuget packages already installed :
- NETStandard.Library 2.0.3
- Xamarin.Essentials 1.3.1
- Xamarin.Forms 4.4.0.991265
Create AdmobControl class In the MainPage.xaml.cs add the AdmobControl with the banner ad id for Android TEST : "ca-app-pub-3940256099942544/6300978111"
In the Android project :
Have theres Nuget packages already installed :
- Xamarin.Essentials 1.3.1
- Xamarin.Forms 4.4.0.991265
Then install the Nuget package Xamarin.Firebase.Ads 71.1601.0
In the MainActivity, inititialize Ads before Xamarin.Forms.Init, with App id for Android TEST : "" -> empty string
Add ACCESS_NETWORK_STATE permission
Add INTERNET permission
Add the line in the AndroidManifest.xml between the tag
Create AdMobRenderer class
The problem :
The compilation is ok BUT, when I deploy on app on my device, I have 2 errors : error: MediationRewardedVideoAdListenerImplementor is not abstract and does not override abstract method zzc(Bundle) in MediationRewardedVideoAdListener public class MediationRewardedVideoAdListenerImplementor TestAdMob.Android C:\Users\TheFloods\source\repos\TestAdMob\TestAdMob\TestAdMob.Android\obj\Debug\90\android\src\mono\com\google\android\gms\ads\reward\mediation\MediationRewardedVideoAdListenerImplementor.java 4
JAVAC0000: error: MediationRewardedVideoAdListenerImplementor is not abstract and does not override abstract method zzc(Bundle) in MediationRewardedVideoAdListener public class MediationRewardedVideoAdListenerImplementor 0
Source code available here : https://github.com/TheFloods/XamarinTestAdMob
I have try following theres tutorials :
- https://www.codeproject.com/Tips/1275283/Xamarin-Forms-Integration-with-Google-Admob
- https://montemagno.com/xamarinforms-google-admob-ads-in-android/
- https://xamarinhelp.com/admob-xamarin-forms-display-google-ads-mobile-app/
Others informations :
- Visual Studio Community 2019 16.5.4
- Windows 10 PRO 1803
Thank you for your help.
Solution
Thank you for your help you two. I have solved the problem like this :
- Uninstall the Xamarin.Firebase.Ads
- Install the Xamarin.Firebase.Ads.Lite
- Add the app ip in the AndroidManifest.xml, after the activity tag
- Install the Xamarin.GooglePlayServices.Ads.Lite, then it works!
Answered By - Flood
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.