[안드로이드 스튜디오] This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled.
2021. 6. 11.

과제하다가 카페에서 테이블에 대가리 박은 썰 푼다.

가 아니라 교수님이 올려주신 예제파일을 안드로이드 스튜디오에서 오픈하자 이런 오류가 나왔다.

 

This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
The following AndroidX dependencies are detected: androidx.core:core:1.5.0, androidx.lifecycle:lifecycle-runtime:2.3.1, androidx.fragment:fragment:1.3.4, androidx.constraintlayout:constraintlayout-solver:2.0.4, androidx.versionedparcelable:versionedparcelable:1.1.1, androidx.appcompat:appcompat:1.3.0, androidx.annotation:annotation-experimental:1.0.0, androidx.customview:customview:1.0.0, androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.collection:collection:1.1.0, androidx.viewpager:viewpager:1.0.0, androidx.activity:activity:1.2.3, androidx.constraintlayout:constraintlayout:2.0.4, androidx.arch.core:core-common:2.1.0, androidx.annotation:annotation:1.2.0, androidx.savedstate:savedstate:1.1.0, androidx.appcompat:appcompat-resources:1.3.0, androidx.lifecycle:lifecycle-common:2.3.1, androidx.tracing:tracing:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.3.1, androidx.lifecycle:lifecycle-livedata-core:2.3.1, androidx.arch.core:core-runtime:2.1.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.vectordrawable:vectordrawable-animated:1.1.0, androidx.vectordrawable:vectordrawable:1.1.0

 

구글링을 해본 결과 AndroidX를 어떻게 어떻게 하는거라고 하던데... 과제하기 급급해서 자세한 내용은 패스

 

간단한 해결방법 :

Gradle Scripts에 gradle.properties에

android.useAndroidX=true
android.enableJetifier=true

이 코드 두줄을 추가하고

오른쪽 상단에 저 코끼리 모양 아이콘 (Sync Project with Gradle Files) 을 눌러준다.

 

그러면 성공적으로 빌드했다고 나온다.

 

끝.

myoskin