You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute
XamarinXamarin Problem Overview
My code works fine, but when I added fragments with a new namespace to the project, I began getting the error
> You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute
I've searched online and found several mentions of unlinking assemblies, but I've also read that this will cause additional errors.
Does anyone know how to solve this bug?
Xamarin Solutions
Solution 1 - Xamarin
I found the answer. Right click references and search Export. Just add the Mono.Android.Export to your project.
Solution 2 - Xamarin
Solution 3 - Xamarin
If you're using JetBrains Rider, you can solve the issue by adding the Mono.Android.Export
reference to your Android .csproj
file:
<!-- ExampleApp.Android.csproj -->
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
...
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="Mono.Android.Export" />
</ItemGroup>
...
</Project>
Solution 4 - Xamarin
You don't need download dll from the web if you cant find it in the reference manager
just do following steps:
- Set the target framework to Android 4.4 kit kat
- Add reference mono.android.expert.dll
- set targetFramework as last good target framework
Clean solution and rebuild
I hope it helps you.