I added working ndk-build Makefiles to a Android Studio 2.2 project to be able to debug C++ code within Android Studio. While I am able to build and debug the code, I get weird error messages in the Gradle Console window when I switch the build type from e.g. release to debug. The error message is:
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
process_begin: CreateProcess(NULL, "", ...) failed.
The total number of messages depends on the number of build variants and active ndk ABIs (#buildVariants * #ABIs). If only one ABI and two build variants (debug, release) are configured, the error message is printed 2 times. For two ABIs and 2 build variants it is printed 4 times etc.
Enabling the --debug
option for Gradle shows that the message happens before ndkBuild is done:
...
C:/data/Android/sdk/ndk-bundle/build//../prebuilt/windows-x86_64/bin/echo.exe [armeabi-v7a] "Install ": "libmurl_openal_soft.so => C:\data\private\x\y\Test\project\android\gradle\app\build\intermediates\ndkBuild\debug\lib/armeabi-v7a/libmurl_openal_soft.so"
copy /b/y "C:\data\private\x\y\Test\project\android\gradle\app\.externalNativeBuild\ndkBuild\debug\obj\local\armeabi-v7a\libmurl_openal_soft.so" "C:\data\private\x\y\Test\project\android\gradle\app\build\intermediates\ndkBuild\debug\lib\armeabi-v7a\libmurl_openal_soft.so" > NUL
C:/data/Android/sdk/ndk-bundle/build//../toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-strip --strip-unneeded C:\data\private\x\y\Test\project\android\gradle\app\build\intermediates\ndkBuild\debug\lib/armeabi-v7a/libmurl_openal_soft.so
16:40:51.437 [ERROR] [org.gradle.api.Project] process_begin: CreateProcess(NULL, "", ...) failed.
16:40:51.437 [INFO] [org.gradle.api.Project] External native build debug: done executing ndkBuild
16:40:51.437 [INFO] [org.gradle.api.Project] External native build debug: write build output output C:\data\private\x\y\Test\project\android\gradle\app\.externalNativeBuild\ndkBuild\debug\armeabi-v7a\ndkBuild_build_output.txt
16:40:51.439 [INFO] [org.gradle.api.Project] External native build debug: parse and convert ndk-build output to build configuration JSON
...
I did not notice any negative effect to the build result itself and no error messages are shown if the APK is build. Though, the error messages during build variant switches are irritating. Any hint how to find the root cause of the error messages would be very much appreciated.