【发布时间】:2018-08-16 20:55:47
【问题描述】:
我收到此错误:
Severity Code Description Project File Line Suppression State
Error The "Javac" 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.LongPathHelper.Normalize(String path, UInt32 maxPathLength, Boolean checkInvalidCharacters, Boolean expandShortPaths)
at System.IO.Path.NewNormalizePath(String path, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at System.IO.FileInfo..ctor(String fileName)
at Xamarin.Android.Tasks.ZipArchiveEx.AddFiles(String folder, String folderInArchive)
at Xamarin.Android.Tasks.ZipArchiveEx.AddDirectory(String folder, String folderInArchive)
at Xamarin.Android.Tasks.Javac.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() XamarinApp1.Android
我的应用程序的名称是 XamarinApp1;肯定不会太长吧?
这是一个开箱即用的默认 Xamarin Android XAML 项目...模板没有更改;我只是尝试构建它...
【问题讨论】:
-
Error is pretty explanatory: "System.IO.PathTooLongException: The specified path, file name, or both are too long. 完全限定的文件名必须少于 260 个字符,并且目录名必须少于 248 个字符。”检查目录路径加项目名称,即全限定文件名。
-
向 Windows 奇怪的目录长度限制问好。考虑将解决方案移至更高的目录,例如 `c:\Develop\XamarinApp1`。
-
嗯,解决方案在C:\Users\edkol\Documents\Visual Studio 2017\Projects\XamarinApp1,下面有2个项目;不应该接近 260 个字符......不过,将 XamarinApp1 移动到 C:\VSProjects 似乎已经修复了它......有点?现在我在 styles.xml 中收到所有这些错误,比如“找不到与给定名称匹配的资源:attr 'windowActionBar'。”
标签: c# android visual-studio xamarin