Gradle DSL method not found: ‘apt()’

It’s entirely possible that there’s a way to get your plugins to work. Given your error, I’d start by following what the ButterKnife project uses, get that working, then see if there is a recipe for what you’re trying.

First, in your top-level build.gradle file, include classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' in the buildscript dependencies, such as:

  buildscript {
    repositories {
      mavenCentral()
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:2.0.0'
      classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
  }

Then, in your module’s build.gradle file, include apply plugin: 'com.neenbedankt.android-apt' towards the top.

The links are to the relevant files from the ButterKnife GitHub repo, from the project and the dedicated sample app.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)