Столкновение AndroidX и библиотек поддержки

#android #android-studio #android-support-library #androidx #bottom-sheet

#Android #android-studio #android-support-library #androidx #итог

Вопрос:

Android Studio думает, что я использую зависимости AndroidX, но я не знаю, где. Это сообщение об ошибке, которое я получаю:

  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
 

Если я поставлю это:

 android.enableJetifier=true
android.useAndroidX=true
 

в моем файле gradle.properties, как предполагают люди, он ничего не может найти. Я также пытался перейти на AndroidX из меню рефакторинга в Android Studio, но это не сработало.

Я бы предпочел не использовать AndroidX, потому что я не мог заставить модальный bottomsheetdialog из material design работать с использованием AndroidX, несмотря на все мои усилия.

Если бы кто-нибудь мог понять, почему возникает эта ошибка или где в кодовой базе я использую библиотеки AndroidX, это было бы очень полезно.

https://github.com/AgentDiamond/RunningApp

Комментарии:

1. Вы пытались проанализировать свои зависимости с помощью задачи gradle dependencies? docs.gradle.org/current/userguide /…

Ответ №1:

Хорошо, я исправил это … вся проблема заключалась в том, что после обновления до AndroidX он беспокоился обо всех ранее импортированных библиотеках поддержки, поэтому просто нужно было их прокомментировать и импортировать все правильные библиотеки AndroidX.