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

Works perfectly in Android project, but throws a NotImplementedException in iOS project #138

Open
ShakiFanatico opened this issue Dec 6, 2023 · 1 comment

Comments

@ShakiFanatico
Copy link

ShakiFanatico commented Dec 6, 2023

Hello there!

I've created a mobile game using MonoGame and recently began integrating AdMob. As far as I understand, MonoGame utilizes Xamarin Native under the hood. The integration process on Android has been smooth – simply adding the NuGet package, initializing it in the main Activity, updating the manifest, and it's good to go. I want to express my gratitude for this incredibly easy and user-friendly plugin!

However, when attempting exactly the same integration on the iOS version, I encounter a NotImplementedException:
"This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."

It seems there might be some distinctions between the Android and iOS projects. To provide more context (if it's relevant at all), my MonoGame project targets net8.0-android34.0 for Android (which works like a charm), and for iOS, it targets net8.0-ios16.1.

Could you shed some light on what might be going wrong with iOS? Despite the exception message, the NuGet package is in fact referenced in the main iOS project, and I've also added Xamarin.Google.iOS.MobileAds.

Thanks!

@marcojak
Copy link
Owner

I'm not actually sure why you are receiving this error.
Usually it means that the iOS version of the plugin is not correctly referenced (for example if you install it only in your xamarin main and android projects and not iOS.

I think the issue might be that this plugin is for Xamarin and targets netstandard2.0;xamarinios10;monoandroid13.0;
I'm actually surprised that it works with your project targeting net8 (probably it's backwards compatible).

Maybe you can share with me your Monogame project or if you cannot do it, you could create an almost empty project that compiles with your same options)

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

No branches or pull requests

2 participants