Long path for binary object files doesn't work

I use Gradle 2.3 on Windows to build native binaries.

Building the libraries (gradle build…) results to:
Fatal error: can’t create C:…longPath…\gradle_test\components\myPackage\build\objs\myPackageStaticLibrary\linux_armRelease\myPackageCpp\emj390qohau4ysrcdfcnhmqes\my_testcomponent.o: No such file or directory

The error occures, because the complete path inclusive the name of the object file is too long. (Length of 259 Characters is ok - 260 Characters and more evoke the error).

Is it possible for gradle to use unicode paths when the compiler is called (e.g. -o \\?\C:\…) or is there any other possibility to solve the problem ?

Best regards
Christian

Not that this isn’t a quick fix for you, but I recently ran into similar issues with some code in a plugin that was attempting to write a new file, but it was failing when the paths were longer than that 260 threshold. This was using the “File.createNewFile()” method. Someone suggested I try the analogous NIO interfaces to get better diagnostics, but when I changed the code to use the NIO “Files.createDirectories(path)” method, it didn’t give me better diagnostics, it just worked. For some reason, this gets around the 260 character path limitation.

Thanks for the reply, but i don’t create the file by my own. At building native binaries i define the buildType, targetPlatform, the tool chain, the compiler, the srcDir, compiler-arguments, etc. in build.gradle.
After starting the build task, Gradle calls the compiler with various options and produces the binary object file (library, executable) by itself. As you see it’s ‘inside’ Gradle.
I don’t know if there is any possibility to ‘configure’ Gradle in order that the binary object files with “long path” (> 259 chars) are generated on Window. Can anyone help ?