My project includes NDK
. And this is the build.gradle
file (app-level).
apply plugin: 'com.android.model.application'
model {
android {
compileSdkVersion = 25
buildToolsVersion = "25.0.1"
defaultConfig.with {
applicationId = "com.example.app"
minSdkVersion.apiLevel = 15
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"
}
}
android.buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file("proguard-rules.pro"))
}
}
android.ndk {
moduleName = "HelloARVideoNative"
cppFlags.add("-I${file("/home/obx/Downloads/EasyARSDKSamples/package/include")}".toString())
cppFlags.add("-DANDROID")
cppFlags.add("-fexceptions")
cppFlags.add("-frtti")
stl = "gnustl_static"
ldLibs.add("log")
ldLibs.add("GLESv2")
}
android.productFlavors {
create("arm") {
ndk.with {
abiFilters.add("armeabi-v7a")
}
}
}
android.sources {
main {
jni {
dependencies {
library file("/home/obx/Downloads/EasyARSDKSamples/package/Android/libs/armeabi-v7a/libEasyAR.so") abi "armeabi-v7a"
}
}
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: '/home/obx/Downloads/EasyARSDKSamples/package/Android/libs')
compile 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'
}
This is the error that I do obtain :
Error:Gradle DSL method not found: 'library()'
This is what I tried :
- Getting Error “Gradle DSL method not found: 'compile()'” when Syncing Build.Gradle
- Gradle DSL method not found: android()
- Gradle sync failed: Gradle DSL method not found: 'ependencies()'
This is my top level gradle
file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Question: What is possibly causing this; and how to resolve ?