I am trying to import 'https://code.google.com/p/android-serialport-api/'into Android Studio. Since this project involves ndk, I followed the instructions to build NDK from the following link: http://tools.android.com/tech-docs/new-build-system/gradle-experimental
But after building, I get this error:
Gradle Project refresh Failed
Error:Cause: org.gradle.api.internal.ExtensibleDynamicObject
EDIT: I have 2.5 gradle version installed Here's my build.gradle
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig.with {
applicationId = "android_serialport_api.sample"
minSdkVersion.apiLevel = 17
targetSdkVersion.apiLevel = 22
android.ndk {
moduleName = "serial_port"
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.txt')
}
}
android.productFlavors {
create("all")
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
}