Issue
I imported a project that I was working on from an Eclipse Android SDK environment to the new Android Studio. Trying to run the project I get this
Error:Execution failed for task ':app:compileDebugNdk'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'ndk/ndk-build'' finished with non-zero exit value 2
So first of all for me it's weird to see this error, because working in Eclipse Android SDK before, I ran ndk-build by myself which I still do. So is Android Studio running ndk-build for me now? Because when I run it in Terminal I have no problem at all and here it tells me bad exit-value.
And then I searched on the internet and found a "quick fix", which is to create an empty .c file, because you can't build/run ndk project with no .c files. This, not surprisingly, does not work for me because we have plenty of .c files in the .jni folder.
Just to mention I'm on a Macbook Pro under Yosemite, and the project should have no problems in itself.
Thanks in advance for any help.
Solution
This is known problem of Android Studio, caused by very limited support of NDK-enabled projects. Answering to your question: yes, Android Studio now run ndk-build on its own, but it ignore existing Android.mk and generate one on the fly (and do it wrong for any non-trivial NDK-enabled project). Practically, the best way to fix this is to disable Android Studio's limited NDK support and call ndk-build from gradle script. Here I've described it more detailed and how to get it fixed.
Answered By - Dmitry Moskalchuk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.