0

I recently switched to ButterKnife version 7.0.1 and I keep getting this error. It points to this part of the code:

Here's the exact part of the code:

public class SupportedBanksActivity extends AppCompatActivity {


 @Bind(R.id.activity_supported_banks_lv)
    ListView mListView;

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_supported_banks);
        ButterKnife.bind(this);
    }
}

and the error:

error: cannot find symbol method bind(SupportedBanksActivity)

I don't understand why it says that. I can go into this method of the ButterKnife library and I see that's it's there. I have made the following changes to my code:

build.gradle

lintOptions {
  disable 'InvalidPackage'
}

packagingOptions {
  exclude 'META-INF/services/javax.annotation.processing.Processor'
}

dependencies {
    compile 'com.jakewharton:butterknife:7.0.1'
}

proguard-rules.txt

-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }

-keepclasseswithmembernames class * {
    @butterknife.* <fields>;
}

-keepclasseswithmembernames class * {
    @butterknife.* <methods>;
}
nsmirosh
  • 45
  • 2
  • 8

1 Answers1

0

Hello i have used butterknife example and my gradle file didn't contain your lines having in your gradle file so may be that could be the issue try

removing below lines from it :->

lintOptions {


 disable 'InvalidPackage'

}

packagingOptions {
  exclude 'META-INF/services/javax.annotation.processing.Processor'
}
Hardy
  • 2,576
  • 1
  • 23
  • 45