You need to add a reference to Mono.Android.Export.Dll when you use ExportAttribute or ExportFieldAttribute

Xamarin

Xamarin 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

enter image description here I added reference like @Jeremy Said, it's working

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:

  1. Set the target framework to Android 4.4 kit kat
  2. Add reference mono.android.expert.dll
  3. set targetFramework as last good target framework

Clean solution and rebuild

I hope it helps you.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRupertView Question on Stackoverflow
Solution 1 - XamarinRupertView Answer on Stackoverflow
Solution 2 - XamarinArun Prasad E SView Answer on Stackoverflow
Solution 3 - XamarinRyan PayneView Answer on Stackoverflow
Solution 4 - XamarinAli BesharatiView Answer on Stackoverflow