Using android package in shared project code

Matt Dietsche 1 Reputation point
2020-12-02T04:52:26.96+00:00

I'm adding android-specific "Xamarin.Android.MP4Transcoder" NuGet package only to the android project in a shared project. My understanding is that I can use the package in shared project files by wrapping it in #if __ANDROID__ statements. But when I try adding the namespace in a shared project file, visual studio says that the namespace doesn't exist. Can I not do this?

I understand that it might not be the best way to do it, but I'm working on adding something to an existing project, and refactoring things to use interfaces for sharing code across platforms isn't feasible for me at the moment.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,396 questions
{count} votes