Error:Could not find method annotationProcessor() for arguments [org.apache.logging.log4j.core]

Viewed 1823

I am using Android Studio 3.0.8, gradle - 4.1.

I've added in my module build.gradle log4j2 dependency and necessary for it annotation processor:

compile "org.apache.logging.log4j:log4j-core:2.8"
annotationProcessor 'org.apache.logging.log4j:log4j-core:2.8'

But I've got the error:

Error:Could not find method annotationProcessor() for arguments [org.apache.logging.log4j.core] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Annotation process is enabled in default settings: https://yadi.sk/i/MinCMsK33LZkjM

I am using libgdx. Build.gradle (module - core):

apply plugin: "java"

targetCompatibility = 1.8
sourceCompatibility = 1.8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'

sourceSets.main.java.srcDirs = [ "src/" ]

eclipse.project {
    name = appName + "-core"
}

dependencies {
    compile  "org.apache.logging.log4j:log4j-core:2.8"
    annotationProcessor 'org.apache.logging.log4j:log4j-core:2.8'
}

I was trying to add it to project build.gradle, invalidate cash. But error remains the same. Gradle can not apply annotationProcessor to log4j2.

0 Answers
Related