Android Studio error package android.support.annotation solution does not exist

Add comment when called
Import butterknife.ButterKnife;
Import butterknife.OnClick;
packet error has been non-existent package android.support.annotation appear, try online all the methods are not resolved, the final study butterknife solve this problem, solution as follows:
1.the load-dependent build.gradle the dependencies of butterknife loaded into the appropriate version.

The reason for the problem is:
the Android studio upgrade package uses androidx load to load, low version butterknife still use the android.support loaded, it will not suggest this package so look butterknife when the package must ensure that version. loading the annotation is androidx way, so as not being given, as shown below: Here Insert Picture Description
If you have questions please leave a message discussion.

Published 22 original articles · won praise 9 · views 2896

Guess you like

Origin blog.csdn.net/weixin_44377507/article/details/104715359