我正在 Xamarin 中制作一个 Android 项目。我正在向其引用 Azure 移动服务 NuGet 包。
我正在使用 http://azure.microsoft.com/en-us/documentation/articles/partner-xamarin-mobile-services-android-get-started-users/ 构建应用程序.
但是当我构建项目时,我收到如下错误:-
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error: Duplicate managed type found! Mappings between managed types and Java types must be unique. First Type: 'Xamarin.Auth.AndroidAccountStore/SecretAccount, Microsoft.WindowsAzure.Mobile.Ext, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'; Second Type: 'Xamarin.Auth.AndroidAccountStore/SecretAccount, Xamarin.Auth.Android, Version=1.2.2.0, Culture=neutral, PublicKeyToken=null' (AppName)
可能出了什么问题?
最佳答案
问题是您使用 Xamarin.Auth 和 MobileServices,并且由于 MobileServices 在内部使用 Xamarin.Auth,因此会发生冲突。更多详情请参见click 。 这里也有类似的帖子click 我已经设法找到解决方法。创建一个可移植类库,在其中添加移动服务的 block 版本。通过这种方式,您可以对 pcl 中的现有移动服务进行包装。这显然是有效的,并且在错误修复之前它是最好的解决方案。如果您有任何疑问,请随时提问。
关于android - Xamarin android 发现重复的托管类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24198128/