Archinamon / android-gradle-aspectj

gradle plug-in adding supports of AspectJ into Android project
Apache License 2.0
363 stars 58 forks source link

Unable to find method 'com.android.build.gradle.BasePlugin.getVariantManager() #119

Closed Muhammadyoussef closed 4 years ago

Muhammadyoussef commented 4 years ago

Integration code

buildscript {

    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.3'
        classpath 'com.archinamon:android-gradle-aspectj:4.2.1'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.archinamon.aspectj'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        minSdkVersion 24
        targetSdkVersion 29
    }
}

Expected Behavior

Compile & run with no issues

Actual Behavior

Compilation error

ERROR: Unable to find method 'com.android.build.gradle.BasePlugin.getVariantManager()Lcom/android/build/gradle/internal/VariantManager;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Library Version

4.2.1

Android Studio Version

3.6.3 & 4.0

Muhammadyoussef commented 4 years ago

Upgrading gradle to 4.0.0 solved the issue