Imported type defined multiple times on Xamarin.Android

笑着哭i 提交于 2019-12-25 02:19:56

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/23496549/imported-type-defined-multiple-times-on-xamarin-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!