Questions tagged [androidx]

New Android extension libraries (AndroidX) which represents an Android Support Library.

New package structure to make package structure clearer which packages are bundled with the Android operating system, and which are packaged with Android app's APK. Going forward, the android.* package hierarchy will be reserved for Android packages that ship with the operating system; other packages will be issued in the new androidx.* package hierarchy.

Existing packages are being refactored to use the new hierarchy. Historical artifacts—those versioned 27 and earlier, and packaged as android.support.* —will remain available on Google Maven; however, all new development will occur in the new androidx.*-packaged artifacts versioned starting from 1.0.0.

Release blog

Official Google Doc

AndroidX release notes

AndroidX refactoring

2486 questions
26
votes
6 answers

android x design dependency

How can I import androidx design dependency I have tried to import : implementation 'androidx.design:design:1.0.2' app compact version is : implementation 'androidx.appcompat:appcompat:1.0.2' I have got this error - ERROR: Failed to resolve:…
Ruchira Swarnapriya
  • 879
  • 2
  • 11
  • 23
26
votes
5 answers

AndroidX MultiDex not found

I'm creating a new android project and decided to use the new AndroidX replacement for the support libraries, docs for which can be found here: https://developer.android.com/jetpack/androidx/migrate. I followed the steps to the letter and after…
Thomas Cook
  • 4,371
  • 2
  • 25
  • 42
26
votes
3 answers

With API 28 and "androidx.appcompat" library project says "AppCompatActivity" symbol not found

I updated my build and target version to 28 (Pie) and replaced the relevant dependencies. Now my project says Symbol not found on AppCompatActivity. I have tried to Clean project Rebuild project Invalidate Caches / Restart But the result is the…
Inzimam Tariq IT
  • 6,548
  • 8
  • 42
  • 69
26
votes
3 answers

Floating action button in andoidx library

Hi is there anyone knows how to use the floating action button with andoidx library I think in android x library they replace implementation 'com.android.support:appcompat-v7:xx.xx.xx' by implementation 'androidx.appcompat:appcompat:1.0.0' but…
Virendra Varma
  • 895
  • 1
  • 12
  • 23
25
votes
4 answers

How do I use activityScenarioRule?

I'm following the dev guide here: https://developer.android.com/guide/components/activities/testing and have a test class like: @RunWith(AndroidJUnit4::class) class MyTestSuite { @get:Rule var activityScenarioRule =…
Stephen__T
  • 2,004
  • 3
  • 25
  • 48
25
votes
2 answers

What's alternative to 'AppBarLayout$ScrollingViewBehavior' in AndroidX?

I've recently migrated my project to AndroidX. Now when I open specific page of the app that has code below, the app Crashes
DrMorteza
  • 2,067
  • 2
  • 21
  • 29
25
votes
7 answers

Youtube player support fragment no longer working on Android studio 3.2 (androidx)

I just updated my Android Studio to version 3.2 and followed instructions to use androidx. I've been using a Youtube fragment inside a Fragment activity and everything worked perfectly but, after the update, these 3 simple lines now give me the…
Nicola Salvaro
  • 505
  • 1
  • 5
  • 14
24
votes
4 answers

How to make BaseFragment with View Binding

My BaseFragment: abstract class BaseFragment : Fragment() { protected abstract val viewModel: ViewModel private var _binding: Binding? = null protected val binding get() = _binding!! …
24
votes
2 answers

Android WorkManager Worker can not be injected using Dagger Hilt `@WorkerInject`

I am trying to follow guide from https://developer.android.com/training/dependency-injection/hilt-jetpack#workmanager and encountered following error E/WM-WorkerFactory: Could not instantiate com.example.android.hilt.ExampleWorker …
Hossain Khan
  • 6,332
  • 7
  • 41
  • 55
24
votes
4 answers

Use legacy support library option in android

Should I select the Use legacy android.support libraries option when creating a new project? What will happen if I don't select this option?
24
votes
2 answers

BottomNavigationView using androidx

I have created some app and I had like to insert to it a BottomNavigationView. The code worked perfectly however once I changed at my gradle to androidx it stopped working. The component in my layout…
24
votes
2 answers

android studio 3.5 Warning: The rule `-keep public class * extends androidx.versionedparcelable.VersionedParcelable { (); }` uses extends

Today, I updated my Android Studio to 3.5. After updated, I found below warning when I try to run the app. The rule -keep public class * extends androidx.versionedparcelable.VersionedParcelable { (); } uses extends but actually matches…
ZarNi Myo Sett Win
  • 1,353
  • 5
  • 15
  • 37
24
votes
2 answers

SearchView crashes with inflation error (androidx) - resource not found exception

I have a SearchView in one of my layouts and get appended crash on some devices. The problem is that the abc_textfield_search_material resource is not found. But I'm not using this resource directly, as my xml layout simply looks like…
prom85
  • 16,896
  • 17
  • 122
  • 242
24
votes
3 answers

AndroidX package android.support.design.R does not exist

When I convert my Project to AndroidX I run into error: package android.support.design.R does not exist android.support.design.R.styleable.FloatingActionButton_Behavior_Layout); any clue how to solve it ?
hannes ach
  • 16,247
  • 7
  • 61
  • 84
24
votes
2 answers

Cannot invoke observeForever on a background thread

I've been using an observeForever() method as described here to test Room and LiveData for a while, and it has worked flawlessly. But when I changed to Android Studio 3.2 (or if it was the androidx refactoring, not sure), that method suddenly…