TheIgnobleSavage
TheIgnobleSavage

Reputation: 25

AndroidX and support libraries clashing

Android Studio thinks I am using AndroidX dependencies but I do not know where. This is the error message I am getting:

 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.fragment:fragment:1.0.0, androidx.slidingpanelayout:slidingpanelayout:1.0.0, androidx.versionedparcelable:versionedparcelable:1.1.0, androidx.core:core:1.2.0, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.interpolator:interpolator:1.0.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0.0, androidx.viewpager:viewpager:1.0.0, androidx.collection:collection:1.0.0, androidx.localbroadcastmanager:localbroadcastmanager:1.0.0, androidx.lifecycle:lifecycle-common:2.0.0, androidx.arch.core:core-common:2.0.0, androidx.annotation:annotation:1.1.0, androidx.legacy:legacy-support-core-ui:1.0.0, androidx.lifecycle:lifecycle-livedata:2.0.0, androidx.lifecycle:lifecycle-viewmodel:2.0.0, androidx.lifecycle:lifecycle-livedata-core:2.0.0, androidx.arch.core:core-runtime:2.0.0, androidx.legacy:legacy-support-core-utils:1.0.0, androidx.documentfile:documentfile:1.0.0, androidx.cursoradapter:cursoradapter:1.0.0, androidx.lifecycle:lifecycle-runtime:2.0.0, androidx.coordinatorlayout:coordinatorlayout:1.0.0, androidx.asynclayoutinflater:asynclayoutinflater:1.0.0, androidx.print:print:1.0.0

If I put this:

android.enableJetifier=true
android.useAndroidX=true

in my gradle.properties file like people suggest then it can't find anything. I've also tried upgrading to androidX from the refactor menu in Android Studio but it didn't work.

I'd rather not have to use androidX because I couldn't get the modal bottomsheetdialog from material design to work using androidX despite my best efforts.

If anyone could work out why this error is happening or where in the codebase I am using androidX libraries that would be very helpful.

https://github.com/AgentDiamond/RunningApp

Upvotes: 0

Views: 345

Answers (1)

TheIgnobleSavage
TheIgnobleSavage

Reputation: 25

Ok I fixed it...all the problem was, was that after updating to androidX, it was freaking out about all the previously imported support libraries, so just had to comment them out and import all the correct androidX ones.

Upvotes: 1

Related Questions