LawfulChaotic
LawfulChaotic

Reputation: 91

The "GradleBuild" task failed unexpectedly

I have VS2010 with nvidia CodeWorks for android, updated with the latest version. My project built fine on ant, but after switching to gradle the following error occurs:

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>

I'm not sure what went wrong here- does it fail to find tools (environment variables look correct), or cannot find manifest (same as for ant build, which worked). Tried to reinstall codeworks, but error remains the same. Probably I'm missing some paths or environment variable, but no idea which ones.

The latest CodeWorks have the following components:

Upvotes: 0

Views: 231

Answers (1)

LawfulChaotic
LawfulChaotic

Reputation: 91

So it seems I can answer that myself...

CodeWorks for Android 1R3 installs the latest version of android build tools into NVPACK\android-sdk-windows\build-tools\android-6.0 folder, where VS tegra plugin cannot find it. (VS tegra plugin was also installed by CodeWorks for Android 1R3, so I was expecting some compatibility between components of same package.) Installing any other build tool version with Android SDK manager (located in NVPACK\android-sdk-windows) solves the issue. Renaming android-6.0 folder to anything like version number x.x.x (i. e. 23.0.2) also works.

Upvotes: 0

Related Questions