Using Butter Knife library for view injection

后端 未结 3 1651
暗喜
暗喜 2020-12-15 13:14

What i am doing::

  1. I am trying to run butter knife library for my simple project
  2. I have followed all the steps in documentation, but s
相关标签:
3条回答
  • 2020-12-15 13:23

    Follow this Steps [ into Eclipse IDE ]:

    1)Right click on your project withIn Package Explorer. Got to Java Compiler --> Annotation Processing and check the Enable project specific settings.

    2)Expand the Annotation Processing section and select Factory Path. Check Enable project specific settings and then click Add JARs Navigate to the project's libs/ folder and select the ButterKnife jar.

    3)Click Ok to save the new settings. Eclipse will ask you to rebuild your project to which you should click Yes.

    Note: Make sure that the .apt_generated/ folder is in your project root. It should contain files like YOURACTIVITY$$ViewInjector.java. If these files are not present trigger a clean build by selected Project → Clean. This folder and files should not be checked into revision control.

    Reference -> Set up manual configuration for ButterKnife annotations

    0 讨论(0)
  • 2020-12-15 13:31

    IntelliJ IDEA — If your project uses an external configuration (like a Maven pom.xml) then annotation processing should just work.

    Follow these steps :

    1. Open IDEA's preference: File -> Other Settings -> Default Settings
    2. Navigate to Compiler -> Annotation Processors Then Check Enable annotation processing

    Reference -> Set up manual configuration for ButterKnife annotations

    Update 30-6-2015

    Follow These Steps for Intellij IDEA 14.0 :

    1. Open IDEA's preference: File -> Settings or click ctl + alt + s

    2. Navigate to Build, Execution and deployment -> Compiler -> Annotation Processors and Choose your project Then Check Enable annotation processing

    0 讨论(0)
  • 2020-12-15 13:47

    @Bind replaces @InjectView and @InjectViews. ButterKnife.bind and ButterKnife.unbind replaces ButterKnife.inject and ButterKnife.reset, respectively.

    look at this : @InjectView replaced ...

    0 讨论(0)
提交回复
热议问题