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
96
votes
5 answers

Can't resolve android.support.design. after migration to AndroidX

I am trying to get the TextView of the Snackbar with this code snippet: snackbarView.findViewById(android.support.design.R.id.snackbar_text) but Android Studio does not resolve the design library. How can I get this code to work?
dudi
  • 5,523
  • 4
  • 28
  • 57
92
votes
12 answers

How to load Image from drawable in Jetpack compose?

I have tried below code but it reflects nothing in the UI, I'm missing anything here? class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent…
Maddy
  • 4,525
  • 4
  • 33
  • 53
90
votes
6 answers

Duplicate classes from androidx and com.android.support

I recently updated my Android Studio (and I'm pretty sure the Gradle version), and now I've been getting a bunch of errors when trying to compile my project. Here's the one that is plaguing me at the moment: Duplicate class…
90
votes
21 answers

Error inflating class androidx.constraintlayout.ConstraintLayout after migration to androidx

I just made a migration to androidx through Android Studio menu option Refactor -> Refactor to AndroidX I'm getting the following error: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class…
KevinMo
  • 2,740
  • 2
  • 8
  • 14
89
votes
14 answers

Android FAB icon always black with MaterialComponents theme

I'm creating an Android app and I'm using the AndroidX libraries and Material design theme. My app theme on styles.xml is: