I am trying to create an Android library project with native code. The Known Limitations section at http://tools.android.com/tech-docs/new-build-system/gradle-experimental supports hybrid library projects. But it seems that I do not see the native one, so the files are created in the libs folder of the aar library file.
This is how my project setup looks like
When I run this application, I get an UnsatisfiedLinkError, which I expected, since I do not see any native ones, therefore the files are generated in the aar file.
This is what the build.gradle file looks like in my library
apply plugin: 'com.android.model.library' model { android { compileSdkVersion = 23 buildToolsVersion = "23.0.1" } android.ndk { moduleName = "native" cppFlags = ['-std=c++11'] stl = "gnustl_shared" } }
This is how my build.gradle application module looks like
apply plugin: 'com.android.model.application' model { android { compileSdkVersion = 23 buildToolsVersion = "23.0.1" } } dependencies { compile project(':mylibrary') }
source share