Android 尝试对已绑定的ID 0使用@BindView

Android 尝试对已绑定的ID 0使用@BindView,android,android-studio,gradle,build,build.gradle,Android,Android Studio,Gradle,Build,Build.gradle,Android Studio构建失败,原因是: Attempt to use @BindView for an already bound ID 0 on 'mConnectionMessage' Fragment.java:53: error: Attempt to use @BindView for an already bound ID 0 on 'mConnectionMessage'. ImageView mConnectionImage; ^

Android Studio构建失败,原因是:

Attempt to use @BindView for an already bound ID 0 on 'mConnectionMessage'


Fragment.java:53: error: Attempt to use @BindView for an already bound ID 0 on 'mConnectionMessage'. 
    ImageView mConnectionImage;
              ^
以下是导致问题的代码部分:

    @BindView(R2.id.display_discovery_state_icon)
    ImageView mConnectionImage;
简短回答: 根据:

build.gradle
更改:

classpath 'com.android.tools.build:gradle:3.6.0'
致:

长答案: Android Studio更新是问题的根本原因

更新如下:

"To take advantage of the latest features, improvements, and security fixes, we strongly recommend that you update the Android Gradle plugin from the current version 3.5.3 to version 3.6.0 and Gradle to version 5.6.4. Release notes"
哪些变化:

    classpath 'com.android.tools.build:gradle:3.5.3'

仅通过手动进行上述更改(不一定运行更新),问题就可以重现

注意:
我可以在windows和mac上重现问题并进行修复。

将butterknife的版本升级到10.2.1

是否使用butternife?
就我而言,我升级到了10.2.1版(com.jakewharton:butterknife-gradle-plugin:10.2.1),不再收到消息


我使用的是gradle 3.6.1。

navid vafaei-你是说gradle更新有漏洞吗?@MustafaHussain我想更保守一点,用“gradle更新导致漏洞”这样的词来形容它:
    classpath 'com.android.tools.build:gradle:3.5.3'
    classpath 'com.android.tools.build:gradle:3.6.0'
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip