0% found this document useful (0 votes)
65 views2 pages

Instructions For The New Dagger II and Butter Knife Dependencies

The document provides instructions for updating projects to use newer versions of the Dagger II and Butter Knife dependencies. It explains that the dependencies now use annotationProcessor instead of the apt plugin. Developers need to remove the apt plugin from build.gradle files and change dependency declarations to use annotationProcessor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views2 pages

Instructions For The New Dagger II and Butter Knife Dependencies

The document provides instructions for updating projects to use newer versions of the Dagger II and Butter Knife dependencies. It explains that the dependencies now use annotationProcessor instead of the apt plugin. Developers need to remove the apt plugin from build.gradle files and change dependency declarations to use annotationProcessor.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Instructions for the new Dagger II

and Butter Knife dependencies


Since uploading the video, there is a new release for Butter Knife and Dagger. They have reached
the version 2.9 for Dagger and 2.5.1 for Butter Knife. One of the import changes is the way we are
adding this to our projects. Previously we where adding the apt Gradle plug in and then we would
apply it in the app Gradle file.

Some history about the apt plug in and why we were using this:

Firstly, it would allow to add at compile time only an annotation processor as a dependency and
not including it in the final APK.
The second usage was the generated code could be picked up by Android Studio.

But all of this changed with the Gradle version 2.2 in which an annotation processor was included.
So there is no reason to provide an extra one.

1) In order to update the libraries we only need to remove the class path for the apt from the
build.gradle (Project)

classpath ‘com.neenbedankt.gradle.plugins:android-apt:1.8'

2) Remove the plug in from the build.gradle(app)

apply plugin: ‘com.neenbedankt.android-apt'

3) Change the dependencies from apt to the new annotationProcessor

That’s all.

The same things goes for Butter Knife. Just switch the dependencies to the new ones.
SNIPPETS

compile 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'

compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

You might also like