JniLibs folder displaying cpp folder in Android Studio

I follow this tutorial .

I created the jniLibs folder in app / src / main and it shows when I see the folder in explorer.

However, when I open Android Studio, I see that the application folder has 4 folders: manifests, java, cpp, res. Where did the cpp folder come from? Why can't I see jniLibs folder in android studio?

+5
source share
2 answers

I had the same problem.

At first, you probably created the JNI folder. I assume Gradle believes that the folder contains the source files even after deleting the folder and recreates the jniLibs folder itself (and adds the sourceSets line, similar to the code below).

Check your build.gradle application and find the line

sourceSets { main { jni.srcDirs = ['src/main/jni', 'src/main/jniLibs/'] } } 

in the Android section and delete it, Sync, and then everything should be fine.

+6
source

It should be inside your cpp folder. In Android studio, all cpp-related libraries and files (.so files, .a files, etc.) are located in the cpp folder, so the cpp folder was created.

0
source

Source: https://habr.com/ru/post/1264372/


All Articles