Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// This hack works with, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDir 'src'
res.srcDir 'res'
assets.srcDir 'assets'
resources.srcDir 'src'
test {
java.srcDir 'tests/src'
dependencies {
compile project(':main')
compile fileTree(dir: '../main/libs', include: '*.jar')
compile fileTree(dir: '../thirdparty/actionbar-sherlock/library/libs', include: '*.jar')
task copyNativeLibs(type: Copy) {
from(new File(project(':main').buildDir, 'native-libs')) { include '**/*.so' }
into new File(buildDir, 'native-libs')
tasks.withType(JavaCompile) { javaCompileTask -> javaCompileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType( { pkgTask ->
pkgTask.jniDir new File(buildDir, 'native-libs')

This comment has been minimized.

Copy link

@eljec eljec commented Dec 10, 2014

Hi man !! how are you doing ?
We have a similar problem than you. We took a look your solution, but we do not understand what do you mean with "main". Could you share to us your project structure ?

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment