In my case, it was the exact opposite of point:
This syntax - with jniLibs outside the android block - gave me an error:
android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.mycompany.myproject" minSdkVersion 17 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } sourceSets { main { jniLibs.srcDirs = ['src/main/jniLibs'] } }
and this syntax - inside the android block - fixed it:
android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.mycompany.myproject" minSdkVersion 17 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main { jniLibs.srcDirs = ['src/main/jniLibs'] } } }
source share