Android Studio3.0 配置ButterKnife出錯的解決


需要注意的問題:

(1)ButterKnife.bind(this);必須在設置布局之后進行初始化;

官方升級到了8.8.1了

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

之前還是用的以前的版本

解決辦法:

 dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
     classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
  }

降了一下版本

app插件配置

 apply plugin: 'com.jakewharton.butterknife'

dependencies添加

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

這個辦法親測有效,Android studio 3.0 就能夠使用ButterKnife了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM