buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } apply plugin: 'android' dependencies { } android { compileSdkVersion 17 buildToolsVersion "17" defaultConfig { minSdkVersion 15 targetSdkVersion 17 } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest.setRoot('tests') } signingConfigs { release } buildTypes { release { signingConfig signingConfigs.release } } } // ~/.gradle/gradle.properties if (project.hasProperty('keystoreFile') && project.hasProperty('keystorePassword') && project.hasProperty('keystoreAliasPassword')) { android.signingConfigs.release.storeFile = file(keystoreFile) android.signingConfigs.release.storePassword = keystorePassword android.signingConfigs.release.keyPassword = keystoreAliasPassword android.signingConfigs.release.keyAlias = keystoreAlias } else { buildTypes.release.signingConfig = null } //http://stackoverflow.com/questions/16683775/include-so-library-in-apk-in-android-studio tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> pkgTask.jniDir new File(buildDir, 'native-libs') }