警告:在Visual Studio 2015中创建跨平台Xamarin空白应用程序(Xamarin.Form可移植) [英] Warnings: Creating Cross-plaftorm Xamarin Blank App (Xamarin.Form portable) in Visual Studio 2015

查看:58
本文介绍了警告:在Visual Studio 2015中创建跨平台Xamarin空白应用程序(Xamarin.Form可移植)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试创建上述类型的新项目时,都会收到以下4条警告:

Whenever I try to create a new project of the type mentioned above I get these 4 warnings:

预更新Nuget

Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   xamarinProj1.Droid

2

The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'xamarinProj1, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'xamarinProj1.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(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() xamarinProj1.Droid          Build

3

Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.   xamarinProj1.UWP            Build   

4

Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'   xamarinProj1.UWP    c:\users\user\documents\visual studio 2015\Projects\xamarinProj1\xamarinProj1\xamarinProj1.UWP\xamarinProj1.UWP.csproj      Build   

后坚果:

The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'xamarinProj1, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'xamarinProj1.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(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() xamarinProj1.Droid          Build

3

IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   xamarinProj1.Droid      1   IntelliSense    Active

5

Severity    Code    Description Project File    Line    Source  Suppression State
Warning     Found conflicts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the application configuration file: <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Text.RegularExpressions" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.IO" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Globalization" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Xml.ReaderWriter" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.ObjectModel" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Linq" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Runtime.Extensions" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Collections" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Threading" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Diagnostics.Debug" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Reflection" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Linq.Expressions" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Threading.Tasks" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding><assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><dependentAssembly><assemblyIdentity name="System.Dynamic.Runtime" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /><bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /></dependentAssembly></assemblyBinding>    xamarinProj1.Droid          Build

请注意,即使在模拟器中发出警告,我也看不到该应用程序正在运行(默认的一个"Welcome to Xamarin"标签).另外,当我单击错误#5时,它将再次出现在下一个版本中.

Notice that even though it's a warning in the emulator I don't see that application running (the default one "Welcome to Xamarin" label). Also, when I click on error #5 it will reappear on the next build.

我尝试解决的问题:

  1. 我已经更新了项目Nuget软件包并安装了最新的Forms,也尝试在Nuget Manager中安装该项目的所有更新,但问题仍然存在
  2. 我已经重新安装了Visual Studio和Xamarin
  3. 我已经安装了各种版本的JDK,并尝试更改工具->选项-> Xamarin-> Android的各种JDK文件夹:x64:jdk1.8.0_102,x86:jdk1.7.0_55,jdk1.7.0_79, jdk1.7.0_80,jdk1.8.0_101 (请注意,在您的手动安装中,您建议安装x86,所以我也尝试过安装)
  4. 从英特尔站点安装了最新的XHAM.
  5. 更新了Android SDK,并基本上安装了所有工具(包括平台程序等)以及所有API 23和API 24内容,以及听起来不错的各种附加功能,还安装了最新的NDK
  6. 将项目最低目标更改为更低的Android固件版本(14)
  7. 我已经通过Visual Studio更新了Xamarin
  8. 搜索网络,甚至尝试按照建议重新安装Nuget软件包管理器
  1. I've updated the project Nuget package and installed the newest Forms , also I've tried to install all the updates in Nuget manager for that project and still the problem remains
  2. I've reinstalled Visual Studio and Xamarin
  3. I've installed various version of JDK and tried to change in tools-> options-> Xamarin-> Android the various JDK folders: x64: jdk1.8.0_102 , x86: jdk1.7.0_55,jdk1.7.0_79,jdk1.7.0_80, jdk1.8.0_101 (notice that in your manual installation you suggest to install x86 and so i've tried that as well)
  4. Installed the newest XHAM from Intel site.
  5. Updated Android SDK and installed basically all tools (including platformer and so on) and all API 23 and API 24 content, and various extras that sounds good to have also installed the latest NDK
  6. Change project minimum target to a much lower Android firmware version (14)
  7. I've updated Xamarin via Visual Studio
  8. Searched the net and even tried to reinstall Nuget package manager as one suggested

我必须提到,当我重新安装Xamarin时,原始安装程序保持冻结(如前所述,在卸载后),并且安装程序不断失败,因此我已根据

I must mention that the original installer kept freezing when I've reinstalled Xamarin (after uninstallation as I've mentioned before), and the installer kept failing so I've installed it according to the manual installation guide.

推荐答案

您可能要尝试:

  1. 清理解决方案中的所有项目
  2. 手动删除所有 bin &解决方案中的 obj 目录
  3. 将所有NuGet软件包(解决方案范围内)更新为最新稳定"版本
  4. Package Manager控制台中运行Update-Package –reinstall(并验证所有引用上均未显示警告)
  1. Cleaning all projects in your solution
  2. Manually deleting all bin & obj directories in your solution
  3. Updating all NuGet packages (solution-wide) to the "latest stable" versions
  4. Running Update-Package –reinstall in the Package Manager Console (and verifying that there are no warnings present on any references)

此外,我遇到了与 Xamarin.Forms 有关的错误,该错误要求我从Android项目中卸载 Xamarin.Forms NuGet程序包,然后重新安装最新稳定版"版本的Xamarin.Forms(不是 Xamarin.Android.Support.* 软件包-这些软件包将在重新安装 Xamarin.Forms 时自动安装).

Additionally, I have encountered errors with Xamarin.Forms that required me to uninstall the Xamarin.Forms NuGet package from the Android project and then reinstalling the "latest stable" version of Xamarin.Forms (not the Xamarin.Android.Support.* packages- those will automatically install during the reinstallation of Xamarin.Forms).

执行上述操作通常可以为我解决这些奇怪的错误.我希望这有帮助- 祝你好运!

Doing the above usually resolves these strange errors for me. I hope this helps- good luck!

这篇关于警告:在Visual Studio 2015中创建跨平台Xamarin空白应用程序(Xamarin.Form可移植)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆