Mein Projekt enthält NDK
. Und das ist die build.gradle
Datei (App-Ebene).Wie behebt man den Gradle-Fehler?
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'
}
Dies ist der Fehler, den ich erhalten tun:
Error:Gradle DSL method not found: 'library()'
Das ist, was ich versucht:
- 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()'
Das ist mein Top-Level-gradle
Datei:
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
}
Frage: Was möglicherweise das verursacht; und wie löst man?
Danke für die Antwort, wird :) – OBX
@OBX versuchen, lassen Sie uns wissen, ob dies tatsächlich das Problem war oder ist es etwas anderes – SergGr