Android Studio NDK issue: command "process ... completed with non-zero exit value 2"

Background

I am trying to import an old JJI Eclipse project ( here ) and yet even after all my attempts, I always fail.

The project worked fine on Eclipse (and most of the time) and some users were able to import it and use it on Android-Studio. Everyone except the creator - me.

I passed along the instructions that I was told and also combined all the changes related to this issue, but still doesn't work for me.

What i tried

I tried following steps:

  • Create a folder "jni" in the src / main / folder and copy JniBitmapOprationsLibrary.cpp to that folder
  • Add com.jni.bitmap_operations package and add JniBitmapHolder.java to this package.
  • Add your NDK path to local.properties
  • Import the com.jni.bitmap_operations package where it will be used And that should be fine except for the NewDirectBuffer problem on my side.
  • puts a fake 0-size file "c" in the "jni" folder.

I've tried other special steps I've found, but nothing seems to work. This is the current error I am getting:

Error: Execution completed for task .: Jnibitmapoperationslibrary: compileDebugNdk

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process command 'D: \ android \ ndk \ ndk-build.cmd' ended with non-zero exit value 2

Question

How am I really supposed to import or create JNI projects in Android Studio? Will projects be able to compile and debug?

+3


source to share


1 answer


Hmmm, JNI shouldn't be in src / main. It should be at the top of your project folder.

I think everything. I know there are problems with gradle when trying to create my own projects. Not sure if they still fixed it.



Also, take a look at other ndk tools like "android update project -p". which generates the files needed to build (using ndk-build)

+1


source







All Articles