How to setup ButterKnife plugin in Android Studio?

前端 未结 2 1101
温柔的废话
温柔的废话 2020-12-05 08:48

I need to install the plugin Butter Knife. Where can I download it? I downloaded a .jar plugin (but not if the file is the one I need), I have installed but when I click on

2条回答
  •  醉梦人生
    2020-12-05 08:59

    In Android Studio you can do this by:

    1. Right-click your module
    2. Click 'Open Module Settings'
    3. Click Dependencies Tab
    4. Click the green plus icon
    5. Select 'Library Dependency' from the dropdown list
    6. Enter "butterknife" in the search field and click the search button

    After selecting the library, Android Studio adds the dependency to your module.

    Since butterknife does annotation processing, you have to add this to the build.gradle of your module right after the compile statement for butterknife:

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

    where the version number at the end should match your version of butterknife.

提交回复
热议问题