Is there something like a plugin or a button for Android studio to click and automatically connect ButterKnife.

And then for each application to register all these apt defenders, etc. It bothers.

The thing is very good, it's a pity Google does not implement it by default. One button can immediately get a list of the entire layout id. What is not a programmer’s dream?

Closed due to the fact that the issue is too general for the participants Shwarz Andrei , YuriySPb , user194374, cheops , D-side 11 Jul '16 at 12:29 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    There are many DI Framework, and Google more than once wrote about the caution of their implementation. Moreover, they have their drawbacks, and the situations in which you will catch execips, where there should not be, perfomance, memory, etc., it is over, it makes life easier, but not without pain in projects, so be neat. If you create projects so often and use the same lib, refactor the same code every time, for this purpose there is Custom Projects In Android Studio. This is exactly what you choose when creating a new project, and so, you can customize your custom. If you only need the gradle file, look at the templates:

    C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle-projects\NewAndroidModule\root\build.gradle.ftl 

    enter image description here

    You can also connect libs, from the AS project structure, it is very convenient and the dependencies are pulled automatically. Here is an example:

    enter image description here

    • As for templates, this is very interesting. Apparently what I need) - Andro

    I don’t know about the plugin, but is it really so lazy to do Ctrl + C - Ctrl + V ≈ 10 lines or am I misunderstanding something?

    To connect BK, it is necessary and sufficient to insert into the project level build.gradle

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

    And in the build.gradle module

     apply plugin: 'android-apt' dependencies { compile 'com.jakewharton:butterknife:8.1.0' apt 'com.jakewharton:butterknife-compiler:8.1.0' } 

    The string apply plu ... must be at the top

    Actually the instruction of Jack Worton