Butterknife: cannot find R2 in AS 3.3.1

Created on 1 Mar 2019  ·  12Comments  ·  Source: JakeWharton/butterknife

project build.gradle

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

module build.gradle

apply plugin: 'com.jakewharton.butterknife'

dependencies {
    api project(':modules:base')
    api 'com.jakewharton:butterknife:8.4.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
}

which is can display normally in AS 3.2.1.
and I update AS to version 3.3.1, you can see that R2 is red in IDE, but it can be run and build apks and can be debug in AS. anyway I tried all the idea in the net, and I still cannot resolve the problem.

Chinese Translation:
以上是我的项目中引用的信息,升级AS到3.3.1后,显示R2类找不到,报红,但是项目可以正常运行,也可以正常调试生成APK,但是以上R2报红的问题一直存在,无法解决。请问有没有方法可以解决这个问题?

Most helpful comment

Use 9.0.0

On Thu, Mar 7, 2019 at 10:43 PM alen252 notifications@github.com wrote:

But my project does not support Android X. I still can not use 10.1.0.
How to solve my problem.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JakeWharton/butterknife/issues/1481#issuecomment-470794175,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESxH4cnYfuLQCitEA2VRuptULY09ks5vUdxPgaJpZM4bYm1f
.

All 12 comments

I also tried the butterknife 8.5.1/8.6.0/9.0.0/10.0.0 ... but the project build failed with them
and the butterknife8.4.0 works normally in AS 3.2.1 so I am confused with that, and there is much less info about this on the net.

when I change this

classpath 'com.jakewharton:butterknife-gradle-plugin:10.1.0'

others not changed

everything ok!!!

amazing...

I also got this question.

Thanks! bro, This question has trouble me for days

But my project does not support Android X. I still can not use 10.1.0.
How to solve my problem.

Use 9.0.0

On Thu, Mar 7, 2019 at 10:43 PM alen252 notifications@github.com wrote:

But my project does not support Android X. I still can not use 10.1.0.
How to solve my problem.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JakeWharton/butterknife/issues/1481#issuecomment-470794175,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEEESxH4cnYfuLQCitEA2VRuptULY09ks5vUdxPgaJpZM4bYm1f
.

Use 9.0.0

On Thu, Mar 7, 2019 at 10:43 PM alen252 @.*> wrote: But my project does not support Android X. I still can not use 10.1.0. How to solve my problem. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1481 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEESxH4cnYfuLQCitEA2VRuptULY09ks5vUdxPgaJpZM4bYm1f .

After i upgrade to 9.0.0. I got my project compile error: Program type already present: android.support.v4.app.FrameMetricsAggregator$FrameMetricsBaseImpl

我也遇到这个问题了,怎么解决啊

@alen252 项目不支持Android X是啥意思...

@itzuo 我写那么清楚你看不懂吗...

@alen252 尝试一下升级android support库到27.0.3,compileSdkVersion 升级到 27,如果报红看一些报红的文字逐个解决。

@usherjc 谢谢

Was this page helpful?
0 / 5 - 0 ratings