Android ndk 找不到参数的方法ndk()
我跟在后面 MAC OX 10.11.5 安卓Studio 2.2稳定版 java版本:1.7.0_79 gradle-2.14.1 这是我的app.gradle:Android ndk 找不到参数的方法ndk(),android-ndk,Android Ndk,我跟在后面 MAC OX 10.11.5 安卓Studio 2.2稳定版 java版本:1.7.0_79 gradle-2.14.1 这是我的app.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "com.chenql.helloa
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.chenql.helloandroidjni"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
ndk {
moduleName "hello-android-jni"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
testCompile 'junit:junit:4.12'
}
以下是错误:
打开文件结果显示此代码
ndk {
moduleName "hello-android-jni"
}
应置于“defaultConfig”块下:
在“buildTypes”块之后安装。我还将JNI函数getMsgFromJni()和System.loadLibrary()添加到MainActivity类的末尾。谢谢!真不敢相信谷歌居然没有把他们的文档固定在这上面:该死的废话。就这样。Wew。谢谢你这个摇滚亚洲人。谢谢,你帮了我很多!
ndk {
moduleName "hello-android-jni"
}
defaultConfig {
applicationId "com.chenql.helloandroidjni"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
moduleName "hello-android-jni"
}
}