clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

Is it possible to build an app with some native jni code? #120

Closed gekailin closed 9 years ago

alexander-yakushev commented 9 years ago

Yes, it is possible. I once used OpenCV in a CoA project. Fill in :native-libraries-path, all the rest is quite straightforward.

gekailin commented 9 years ago

Thanks, but I still could not get it work. I run ndk-build first in my project directory, and it compiles my jni code into several .so files in the libs/<arch>/ subdirectories. I added :native-libraries-paths ["libs"] into the :android section of my project.clj, and then run lein droid doall. But it makes no difference.


Finally I found that's because there are some mistakes in my java code. The solution above works well. Sorry for my carelessness.

alexander-yakushev commented 9 years ago

When you build the project with DEBUG=1, does it say Adding native libraries: <list>?

gekailin commented 9 years ago

Thanks~ I didn't know the DEBUG=1 thing before~

alexander-yakushev commented 9 years ago

So, did you manage to build your project?

gekailin commented 9 years ago

Yeah, it was my mistake. Thank you very much!

alexander-yakushev commented 9 years ago

You are welcome!