AndroidX 마이그레이션 이슈

지프치프·2022년 12월 13일
0

Issue(error)

목록 보기
18/20

개요

Your project has set android.useAndroidX=true, but configuration debugRuntimeClasspath still contains legacy support libraries, which may cause runtime issues.
This behavior will not be allowed in Android Gradle plugin 8.0.

네이버 지도 API를 연동하고 빌드하던 도중 위 에러가 발생했다.
원인은 바로 AnroidX 사용 설정에서 비롯되었는데

필자의 프로젝트는 생성할 때 Legacy support library를 포함하지 않고 생성했다.
이는 즉, AndroidX 사용으로 프로젝트가 설정되어 있는데
연동한 네이버 지도 API의 패키지에
Legacy support library가 포함되어 있어서 빌드 중에 에러가 발생한 것이다.

해결방법

간단하다.
프로젝트 내에 gradle.properties 파일로 이동해서

android.enableJetifier=true

위 코드를 추가해주면 된다.
Jetifier란 Legacy suport library를 AndroidX library로
변환해주는 플래그이다.
이 플래그를 사용하여 네이버 지도 패키지에 있는 레거시들을
AdnroidX로 변환해준다.

profile
지프처럼 거침없는 개발을 하고싶은 개발자

0개의 댓글