尝试将 ButterKnife 添加到我的 Gradle 时出现此错误。
当试图把..
compile 'com.jakewharton:butterknife:8.0.1'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
在模块中:app
我收到错误消息。“找不到 Gradle DSL 方法:'apt()'
遵循此处概述的答案 - Gradle DSL method not found: 'apt()'
我把...
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
进入项目 gradle 文件,这会产生相同的“apt()”错误。
最后,尝试放置
'com.neenbedankt.android-apt'
和/或
'android-apt'
如文档中所述 - https://github.com/JakeWharton/butterknife
现在导致相同的 Gradle DSL 方法错误,但这次是“apply()”而不是“apt()”
我怎样才能让它工作?
最佳答案
问题已通过以下在此处找到的答案解决 - How to setup ButterKnife plugin in Android Studio?
感谢 Waqar Younis ( https://stackoverflow.com/users/3678308/waqar-younis ) 提供了上面提供的链接到答案的评论
关于android - ButterKnife - 找不到 Gradle DSL 方法 apt(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37795211/