관리 메뉴

나만을 위한 블로그

[Android] ButterKnife 사용 중 The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten. for androidx 에러 본문

Android

[Android] ButterKnife 사용 중 The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten. for androidx 에러

참깨빵위에참깨빵 2019. 12. 3. 16:34
728x90
반응형

버터나이프를 이용한 예제를 분석하던 중 빌드하다가 이런 에러가 로그캣에 나왔다.

The given artifact contains a string literal with a package reference 'android.support.v4.content' that cannot be safely rewritten. for androidx

 

구글에 쳐보니 스택 오버플로우에 답변이 달려 있다.

 

내가 사용한 버터나이프 버전은 10.0.0인데 안드로이드X에서 사용하려면 이런 문장을 추가해야 한다고 한다.

 

implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'

 

위 문장은 버터나이프 라이브러리를 쓰기 위한 implements 코드고 아래 문장이 추가해야 할 문장이다.

앱 수준 gradle에 이 문장들을 추가하면 에러 없이 버터나이프가 잘 작동한다.

 
반응형
Comments