I had similar issues when migrating to androidx. this issue comes due to the Old Butter Knife library dependency.
if you are using butter knife then you should use at least butter knife version 9.0.0-SNAPSHOT or above.
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'