编译时遇到,The given artifact contains a string literal with a package reference ‘android.support.v4.content’ that cannot be safely rewritten.Libraries using reflection such as annotation processors need to be updated manually to add support for androidx.
原因:
android build.gradle文件中引用的某个库,版本太旧,而工程的minSDK是androidx以上。
解决
将对应的库,更新到最新版本
我的错误库版本是:
原本
annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’
换成
implementation ‘com.jakewharton:butterknife:10.2.1’
annotationProcessor ‘com.jakewharton:butterknife-compiler:10.2.1’