C# ";“瑞士银行”;任务失败
目前,由于这个问题,我的头撞到了墙上,这个错误使我无法构建和运行我的应用程序。这是一个PCL项目C# ";“瑞士银行”;任务失败,c#,android,visual-studio,xamarin,C#,Android,Visual Studio,Xamarin,目前,由于这个问题,我的头撞到了墙上,这个错误使我无法构建和运行我的应用程序。这是一个PCL项目 Error The "GenerateJavaStubs" task failed unexpectedly. System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 c
Error The "GenerateJavaStubs" task failed unexpectedly.
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at Xamarin.Android.Tasks.GenerateJavaStubs.Run()
at Xamarin.Android.Tasks.GenerateJavaStubs.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ConstructionMobileApp.Droid C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1574
Android程序集信息:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
[assembly: AssemblyTitle("ConstructionMobileApp.Droid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConstructionMobileApp.Droid")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
您试图编译的项目的路径是什么 Windows对路径名有限制,因此请尝试将项目移动到较短的命名路径。
例如,如果您使用的默认项目路径是
C:\Users\YourUserName\Documents\VisualStudio2015\Projects\something
,那么可以将其复制到C:\Dev
,只需从以下位置复制答案即可:
尝试在项目中添加此msbuild属性,以缩短obj目录中的文件/文件夹名称
<PropertyGroup>
<UseShortFileNames>True</UseShortFileNames>
</PropertyGroup>
希望能有所帮助。您试图编译的项目的路径是什么?Windows对路径名有限制,因此请尝试将项目移动到较短的命名路径。例如,如果您使用的默认项目路径是C:\Users\YourUserName\Documents\VisualStudio2015\Projects\something,那么可能会将其复制到C:\DevThank you!我只是将我的项目复制到一个新位置并打开它,错误就消失了。会将其标记为答案。这对我有帮助。。!谢谢这应该是公认的答案。添加中间输出路径非常有效。没有使用ShortFileName。
<PropertyGroup>
<UseShortFileNames>True</UseShortFileNames>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<IntermediateOutputPath>C:\MyFolder\MyProj</IntermediateOutputPath>
</PropertyGroup>