Remove “Method is never used” warning for OnClick annotation in Android Studio

后端 未结 4 1934
Happy的楠姐
Happy的楠姐 2020-12-30 18:35

Sorry if this question has been asked before. I am using the Butterknife 5.0 with the latest version of Android Studio(0.5.7). How can I remove the \"Method is never used\"

4条回答
  •  再見小時候
    2020-12-30 19:30

    Add another dependency for the compiler:

    Gradle

    dependencies {
        annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' // new line
        compile 'com.jakewharton:butterknife:8.4.0' // original library
    }
    

    This is recommended on the official website.

    Remember to Build -> Rebuild Project, so it will generate usages and make the warning go away.

提交回复
热议问题