Reputation: 873
In build.gradle, I have commandLine 'jni/ndk-build.cmd'
inside one of my tasks.
The contents of ndk-build.cmd is very simple:
[path containing ndk]\android-ndk-r8e\ndk-build.cmd APP_ABI="all" NDK_DEBUG=0
This works fine if I run "gradle assemble" in the command prompt. Android Studio however fails in the build process:
Information: 1 error
Information: 0 warnings
Error: Gradle: Execution failed for task ':mytask'
> A problem occurred starting process 'command 'jni/ndk-build.cmd''
Is commandLine
not supported in Android Studio? If it matters, I've also tried running Android Studio as administrator (Windows).
Upvotes: 0
Views: 2036
Reputation: 873
I found the solution.
If Making in Android Studio on Windows, the command in build.gradle must be commandLine 'cmd', '/c', 'jni\\be-arm7.cmd'
The 'cmd'
argument isn't necessary if the script is being run from the command prompt, which is why I saw no error doing so.
Upvotes: 1