Closed MatanYamin closed 2 months ago
Hi.
Can you share the log with me?
Right now my guess is that in your Android manifest you haven't added your admob Id.
Could you check that?
If instead the id is there, send me the crash report so I'll be able to identify and fix the issue.
If you don't have the crash report, you could create a public project that has the same issue so I can clone it and find the issue.
I did add the appropriate meta-data (app id) to the Android Manifest before.
Sure, I created a public project and added only the essentials things for the plugin (And didn't change anything else) and it crashes for Android. This is the project, I will be happy to know what's wrong - https://github.com/MatanYamin/TestAdMobPlugin
Note: Change the "APP_ID" with an app id of your own for the test
Just for clarifications, I did the following:
(Using .NET 8.0)
And that's it.
@marcojak
Sir, I have a small update.
It works for both Android and iOS when downgraded the version to 1.4.1
I also noticed that I didn't put the '<meta... APPLICATION_ID....' inside the '<application...' tag in android manifest, but it still didn't work on version 1.4.5 after I fixed it,
Only works for 1.4.1 for some reason.
Hope you'll figure it out soon, this is a great plugin.
Hi @MatanYamin
The project you shared is private or not available. Could you check that it's public and fully accessible? I'll have a look and hopefully, I'll quickly identify and fix the issue with your project or the plugin.
@marcojak
Sorry about that, I made a new one here - https://github.com/MatanYamin/TestAdMobMaui make sure to replace "APP_ID" with your own in the android manifest + MainActivity Init
Again, just for clarifications, I did the following:
(Using .NET 8.0)
Created new MAUI project
And as I said, it works with 1.41 but doesn't work with 1.4.5. Good luck, waiting for updates!
Perfect thanks. I'll update you asap.
I've downloaded the code added a few tweaks to make it work on my Mac M3 and it didn't crash. The code was almost empty, the only thing you added was the init and it simply worked.
Do you have a crash log I can have a look at?
Also, have you tried the sample code? Does it work?
In the sample code, in the csproj I also add the following packages:
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-ios'">
<PackageReference Include="Xamarin.Google.iOS.MobileAds" Version="8.13.0.3" />
<PackageReference Include="MT.Xamarin.Google.iOS.UserMessagingPlatform" Version="1.1.0.4" />
</ItemGroup>
Try to add this to your csproj or even better, try to download the sample code....it's the best way to start with the plugin as it has all the methods and events.
The project was intended to be empty to demonstrate that it crashes when fresh.
Anyway, the mistake might have been on my side, as the 1.4.5 version works for me after some modifications.
I'll definitely be purchasing the unlimited apps license.
Thanks for your help—much appreciated!
Closing as not related to the plugin.
I tried multiple things and the app crashes when using both simulator/real android device.
I want to buy the license but I won't if the plugin doesn't work...
What i did: Installed the plugin (basically even when tried to build now, it crashes)
added .UseMauiMTAdmob() to the MauiProgram
added CrossMauiMTAdmob.Current.Init(this, appId); to MainActivity OnCreate
and the appropiate meta-data to the android manifest.
And it keep crashing when opening the app for Android (Didn't even tried for iOS).