Search code examples
xamarincompiler-errorsxamarin.forms.net-assemblycustom-renderer

Xamarin.Forms with custom renderer for Android yields compiler error


After upgrading to Xamarin.Forms 1.2.3 I'm getting the following compiler error related to the definition of a custom renderer:

Error CS0012: The type `Xamarin.Forms.Platform.Android.FormsViewGroup' is
defined in an assembly that is not referenced. Consider adding a reference to
assembly `FormsViewGroup, Version=1.2.3.0, Culture=neutral,
PublicKeyToken=null' (CS0012) (XFormsNavigation.Android)

What is wrong and how can I fix it?


Solution

  • Not sure, why you have to add a Xamarin.Forms library manually. But here's what to do:

    In packages/Xamarin.Forms.1.2.3.6256-pre4/lib/MonoAndroid10/ (or similar depending on your Xamarin.Forms version) you'll find the library FormsViewGroup.dll. Add it to the references of your Android project and it should compile.