Christopher Francisco Christopher Francisco - 13 days ago 5
Android Question

Imported type defined multiple times on Xamarin.Android

Here are my imports:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Widget;
using Android.Support.V4.View;


Then

var mPager = FindViewById<ViewPager> (Resource.Id.pager);


This line gives me The imported type 'Android.Support.V4.View.ViewPager' is defined multiple times

what is wrong in here?

ps: both v4 and v13 are referenced.

Answer

You can't include V4 and V13. V13 is a superset of V4 and includes V4 in it. So that's why you're getting multiple definitions. Remove the V4 reference and it should work fine.

Comments