“GradleBuild”任务意外失败

时间:2015-11-10 07:52:22

标签: android gradle android-ndk android-gradle

我有VS2010与nvidia CodeWorks for android,更新了最新版本。我的项目在ant上构建得很好,但在切换到gradle后发生以下错误:

5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018: The "GradleBuild" task failed unexpectedly.
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018: System.InvalidOperationException: Sequence contains no elements
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.Tasks.Android.GradleBuild.GetLatestBuildToolsVersion()
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.Tasks.Android.GradleBuild.WriteBuildFile(AndroidManifest manifest)
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.Tasks.Android.AndroidBuildBase`1.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.MSBuildInterop.TrackedToolTask.Nvidia.PentaK.Build.MSBuildInterop.ITrackedToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.MSBuildInterop.Impl.TrackedToolTaskWrapper`1.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands)
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Nvidia.PentaK.Build.MSBuildInterop.ToolTaskBase`2.Execute()
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
5>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(265,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__1.MoveNext()
5>

我不确定这里出了什么问题 - 它找不到工具(环境变量看起来是否正确),或找不到清单(与ant build相同,哪个有效)。试图重新安装代码,但错误仍然相同。可能我错过了一些路径或环境变量,但不知道哪些路径或环境变量。

最新的CodeWorks具有以下组件:

  • 机器人-NDK-r10e
  • Android的SDK窗口
  • 阿帕奇-ANT-1.8.2
  • gradle这个-2.2.1
  • jdk1.7.0_71

1 个答案:

答案 0 :(得分:0)

所以我似乎可以自己回答......

CodeWorks for Android 1R3将最新版本的android构建工具安装到NVPACK \ android-sdk-windows \ build-tools \ android-6.0文件夹中,其中VS tegra插件无法找到它。 (VS Tegra插件也是由CodeWorks for Android 1R3安装的,所以我期望在相同软件包的组件之间有一些兼容性。)安装任何其他构建工具版本与Android SDK管理器(位于NVPACK \ android-sdk-windows)解决了这个问题。将android-6.0文件夹重命名为版本号x.x.x(即23.0.2)也可以。