0

I'm using Android Studio 1.0.2 and I'm working on a project + library where the library has C files in the JNI folder under the appropriate directory. I have a bash script set up to do the NDK builds and the configuration is set up to run the script before the build to generate the .so files.

I have the following in my gradle for the library:

sourceSets.main.jni.srcDirs = []

However, adding this hides all my C files in the project explorer, if I remove this line, all my JNI files show up under a folder called "C" in the project explorer (even though I have it saved in a /jni folder under the library). The build obviously only works if I have the line in but I just can't edit any of my c files in Android Studio as I understand the gradle ndk building is not ready yet.

How do I force Android Studio to show me my c files so I don't have to edit my c sources with an external editor?

Thanks

1 Answers1

0

Looks like I really should explore Android Studio before I post any questions. I was in Android view on the Project Explorer side bar rather than the Project View. The Project view just shows me the exact file structure and I can see my jni files there as it should. There's a little tab on top of the project explorer with a dropdown arrow, just click on that and select Project view.

  • An alternative is to keep `sourceSets.main.jni.srcDirs` filled but disable the gradle tasks that compile and link the native code, see e.g. *[define LOCAL_SRC_FILES in ndk{} DSL](http://stackoverflow.com/a/32640823/192373)*. – Alex Cohn Oct 06 '15 at 19:42