Error : Cannot find built APK using gradle


I use gradle to build my project.

Everything goes fine and gradle shows me BUILD SUCCESSFUL line.

Then I see the following log:
Picked up _JAVA_OPTIONS: -Xms512m -Xmx2048m
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(308,5): warning MSB8015: Forcing a rebuild of all source files due to the contents of “\Tegra-Android\Debug_JB_Part1\gradle.command.1.tlog” being invalid.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Tegra-Android\Nvidia.AndroidBuild.targets(308,5): error : Cannot find built APK in \Tegra-Android\Debug_JB_Part1\build
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

It’s extremely strange, as I can see .apk and -unaligned.apk files in \Tegra-Android\Debug_JB_Part1\build\outputs\apk

What may be wrong? I’m ready to provide any extra information needed.

The strangest thing is, that apk file in \Tegra-Android\Debug_JB_Part1\build\outputs\apk works fine on device.

Hi deko,

Does it occur again after rebuild?
If so, please send us the build Diagnostic log, you set log verbosity to Diagnostic at Tools>options>Projects and Solutions>Build and Run.


Hi Victor,

Yes, it occurs after rebuild.
Here is the link to rebuild solution diagnostic log (11Mb):


Could you change the apk suffix pattern, like XXXX-debug-unaligned.apk not xxxx-debug_xxxx-unaligned.apk?


My gradle scheme name is “Debug_JB_Part1”. Do you mean me to leave just “Debug”?


“Debug” works. “DebugJBPart1” doesn’t.


Well, Victor, I wouldn’t say so. It’s a temporary solution.
I’ve got more than 20 project configurations for different markets, and I need correspondent nsight_tegra_build_overrides_.gradle files.


We have created an internal ticket to track enhance on this.



Any news about the issue?


Hello deko,
Would you kindly share with us the repro sample or the actual Gradle build scripts?
You could send me the link via PM.

Hi Mikhail,

Sorry for the delay.
Here is the link to the sample project:


Denis, thank you for the sample project - we have reproduced the reported behavior.
We have plans to improve the APK detection logic in a future release.