Android基础之如何在AS中导入jniLibs目录

1 编辑app目录下的build.gradle文件,为其添加以下代码:

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

2 完整的build.gradle文件如下所示:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "com.adwo.gamecenter.civetcoffeegamecenter"
        minSdkVersion 9
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:20.0.0'
}

转:http://blog.csdn.net/chenliguan/article/details/51747305

你可能感兴趣的:(android)