如何为Android NDK的gradle构建文件中指定NDK
1个回答
展开全部
apply plugin: 'com.android.model.application'
model{
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.1"
defaultConfig.with {
applicationId = "com.kltz88.car.jnidemo"
minSdkVersion.apiLevel = 14
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
tasks.withType(JavaCompile) {
//指定编译JDK版本
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
}
android.ndk {
moduleName = "test"
ldLibs +="log"
abiFilters +="armeabi"
abiFilters +="armeabi-v7a"
abiFilters +="x86"
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file( 'proguard-rules.pro')
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
附上出处链接:http://www.codeceo.com/article/android-studio-gradle-ndk.html
model{
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.1"
defaultConfig.with {
applicationId = "com.kltz88.car.jnidemo"
minSdkVersion.apiLevel = 14
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
tasks.withType(JavaCompile) {
//指定编译JDK版本
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
}
android.ndk {
moduleName = "test"
ldLibs +="log"
abiFilters +="armeabi"
abiFilters +="armeabi-v7a"
abiFilters +="x86"
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file( 'proguard-rules.pro')
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
附上出处链接:http://www.codeceo.com/article/android-studio-gradle-ndk.html
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询