Xamarin Android:自相矛盾的依赖要求?

时间:2015-04-09 08:46:38

标签: c# android xamarin dependencies

在Xamarin Studio中尝试构建我的Android项目时,我不断遇到这样的错误:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): 
Error: Exception while loading assemblies: System.IO.FileNotFoundException: 
Could not load assembly 'Mono.Android.Support.v4, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. 
Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Mono.Android.Support.v4.dll'
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
   at Xamarin.Android.Tasks.ResolveAssemblies.Execute() (Akva20150407)

-

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): 
Error: Exception while loading assemblies: System.IO.FileNotFoundException: 
Could not load assembly 'Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. 
Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Xamarin.Android.Support.v4.dll'
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
   at Xamarin.Android.Tasks.ResolveAssemblies.Execute() (Akva20150407)

-

C:\progge\Apper\Akva20150407\Akva20150407\Act_MainGUI.cs(29,29): 
Error CS0433: The type 'Android.Support.V4.App.FragmentActivity' exists in both 
'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v5.0\Mono.Android.Support.v4.dll' and 
'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v5.0\Xamarin.Android.Support.v4.dll' 
(CS0433) (Akva20150407)
  • 我必须将Xamarin.Android.Support.v4添加到MonoAndroid文件夹中,否则会抱怨它无法找到它。
  • 我必须将Mono.Android.Support.v4添加到MonoAndroid文件夹中,否则会抱怨它无法找到它。
  • 如果我同时添加两者,它会抱怨可以在两个包中找到FragmentActivity。
  • 这些包是通过NuGet安装的。

它看起来非常自相矛盾......我到底应该做些什么才能让它发挥作用?

1 个答案:

答案 0 :(得分:0)

升级您的Xamarin Studio

此错误已在Xamarin Studio中修复:5.7.0.436。 请参阅错误报告:https://bugzilla.xamarin.com/show_bug.cgi?id=24276