Part of my problem was an issue in the upgrade to AS 2.0. After fixing that issue I was able to do a quick test with the Hello World template project. I added a module and modified it to use the experimental plugin.
build.gradle (ndk module)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle-experimental:0.4.0"
}
}
dependencies {
repositories {
jcenter()
}
}
apply plugin: 'com.android.model.library'
model {
android {
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
defaultConfig.with {
minSdkVersion.apiLevel = 11
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1"
}
}
}
Summary Update
I managed to get it working with ndk in a much more complicated project.
Here are the four primary requisites to get it working:
- plugin gradle-experimental:0.4.0+ in your ndk module build.gradle (also convert to the new DSL)
- plugin gradle:1.5.0 in your project build.gradle
- Gradle 2.8 (gradle:1.5.0 plugin requires it)
- Remove all jni from your main project (moved to module) since it's deprecated in 1.3.0+.
Without the combination of those versions of the gradle plugins I had lots of errors. Bit of a headache working out the kinks, but now I've segregated my ndk headaches to a simple module and I can integrate things like crashlytics that don't play well with gradle-experimental.