我试图使用Xamarin.
Android.Support库版本25.3.1,但由于一个错误,我决定降级回我以前的版本23.3.0.降级后,我收到以下错误消息.无论我尝试什么,我都无法摆脱它.我试图删除所有bin,obj,tmp等文件夹.重启VS2015,清理,重建……
Severity Code Description Project File Line Suppression State Error Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.Fragment,Version=1.0.0.0,Culture=neutral,PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? File name: 'Xamarin.Android.Support.Fragment.dll' at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference,ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver,ICollection`1 assemblies,AssemblyDefinition assembly,Boolean topLevel) at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)
我在package.config文件中发现了一个小小的变化.以下都是
targetFramework =“monoandroid71”现在.在升级降级之前,他们是targetFramework =“monoandroid70”,我将它们替换为manulla但是,它根本没有帮助.我该如何解决这个问题?
<package id="Xamarin.Android.ShortcutBadger" version="1.1.809" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.CustomTabs" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.Design" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.v4" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.v7.AppCompat" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.v7.CardView" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" targetFramework="monoandroid71" /> <package id="Xamarin.Android.Support.v7.Palette" version="23.3.0" targetFramework="monoandroid71" />
更新:
我已经重新安装了所有nugetpackages并成功运行1个pc上的android项目,但有趣的是同一个项目没有在另一台PC上运行.它返回不同但相似的错误.
Severity Code Description Project File Line Suppression State Error The "ResolveLibraryProjectImports" task Failed unexpectedly. System.IO.FileNotFoundException: Could not load assembly 'myApp,Version=0.0.0.0,PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile? File name: 'myApp.dll' at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference,ReaderParameters parameters) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName,ReaderParameters parameters) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName) at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly(String fileName) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res,ICollection`1 jars,ICollection`1 resolvedResourceDirectories,ICollection`1 resolvedAssetDirectories,ICollection`1 resolvedEnvironments) at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() myApp.Droid