How can I add .so files to an android library project using gradle 0.7+

In the end I didnt need to use product flavours.

For the library project I added the following:

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }        
}

The libs folder had a folder inside called “armeabi-v7a” and as this is my only target it worked a treat.

The ndk files (.so) are propagated into the android project that is using the android library project.

Leave a Comment