问题
After adding the FlurlHttp Nuget package to my PCL project my app will no longer deploy to my emulator due to an assembly loading error
Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'PCLStorage.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'PCLStorage.Abstractions.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.AddAssemblyReferences(ICollection
1 assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute() InfoSupport.AV.MobileClient.Droid C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1347
The build system is also reporting conflicts :
There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". (TaskId:77) 2> "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it was primary and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes" was not. (TaskId:77)
There was a conflict between "PCLStorage.Abstractions, Version=0.9.6.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64" and "PCLStorage.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64". (TaskId:142) 2> "PCLStorage.Abstractions, Version=0.9.6.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64" was chosen because it was primary and "PCLStorage.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=286fe515a2c35b64" was not. (TaskId:142)
These errors appeared after adding the Microsoft.Build.Async (1.0.168)
, Microsoft.Bcl.Build(1.0.21)
, Microsoft.Net.Http(2.2.29)
, Microsoft.Bcl (1.1.10)
nuget packages to my
PCL project, Xamarin forms project and Xamarin Droid project.
In addition, the Nuget packages Xamarin.Forms.Maps (v2.1.0.6508)
and Xamarin.Forms (v2.1.0.6508-pre3)
are used.
回答1:
Adding the nuget package PclStorage v1.0.2 to the PCL project resolves both warnings and the deployment error.
I'm not sure why this dependency is there.
来源:https://stackoverflow.com/questions/35265236/xamarin-could-not-load-assembly-pclstorage-abstractions