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
24
votes
2 answers

AndroidX Build Fails in Release Mode regarding appComponentFactory

I'm using Android P and compiling against AndroidX. Works great in debug/beta, but when I make a release I get a cryptic crash during runtime: 2018-06-24 00:21:26.080 11971-11971/? E/LoadedApk: Unable to instantiate appComponentFactory …
user2836797
23
votes
2 answers

ActivityResultContracts.TakePicture()

In androidx.activity version 1.2.0-alpha05 API for TakePicture contract has been changed: The TakePicture contract now returns a boolean indicating success rather than a thumbnail Bitmap as this was very rarely supported by camera apps when writing…
Werner Harnisch
  • 850
  • 1
  • 7
  • 10
23
votes
2 answers

What is the actual duration of a Snackbar with LENGTH_LONG

Since I've migrated my Android Project to AndroidX i am receiving the following lint error: Error: Must be one of: Snackbar.LENGTH_INDEFINITE, Snackbar.LENGTH_SHORT, Snackbar.LENGTH_LONG [WrongConstant] Snackbar snackbar =…
ice_chrysler
  • 2,633
  • 1
  • 21
  • 27
23
votes
6 answers

I did not Import the Recycler View AndroidX Library, yet, I am using it. Why and How is it working?

build.gradle(app) android { compileSdkVersion 28 defaultConfig { applicationId "com.example.todolistapp" minSdkVersion 16 targetSdkVersion 28 versionCode 1 versionName "1.0" …
EdgeDev
  • 2,376
  • 2
  • 20
  • 37
23
votes
1 answer

Didn't find class "androidx.core.widget.DrawerLayout"

After migrating to Androidx packages using Android Studio menu option Refactor -> Refactor to Androidx... my build.gradle looks like implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' implementation…
hannes ach
  • 16,247
  • 7
  • 61
  • 84
23
votes
2 answers

androidx.constraintlayout.widget.constraintlayout don't have chains that you can drag

I'm using androidx.constraintlayout.widget.ConstraintLayout in my layout and it does not show the chains, also I can't drag any widgets. I just type the constraints that I want to use.
22
votes
3 answers

After migration to AndroidX, exception at start up: java.lang.ClassNotFoundException: "Didn't find class androidx.core.app.CoreComponentFactory"

After migration to AndroidX i have the following exception at startup: LoadedApk: Unable to instantiate appComponentFactory java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path:…
RACSO
  • 239
  • 1
  • 2
  • 7
22
votes
12 answers

Note: Failed to read get kotlin metadata for [Ljava.lang.Object;@79d6c4df

I keep getting this error. I am working on a project and in the middle of development, I decided to migrate to Android X. I get the error below: Note: Failed to read get kotlin metadata for [Ljava.lang.Object;@79d6c4df There is the same error in…
dawn
  • 397
  • 5
  • 13
22
votes
1 answer

Could not set unknown property 'useAndroidX' for object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

I want to add a library that i've found on github but it required androidx.I found out that i should put these: android.useAndroidX=true android.enableJetifier=true here defaultConfig { applicationId "com.kolydas.greeksinbrno" minSdkVersion…
Alex
  • 1,816
  • 5
  • 23
  • 39
22
votes
5 answers

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch

I'm using androidx navigation architecture along with Kotlin 1.2.71 in Android studio 3.2.1. My fragment code is: package com.dell.andnav.fragments import android.os.Bundle import android.support.v4.app.Fragment import…
Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
22
votes
7 answers

dagger android support to androidx.fragment

How to inject a fragment from the package androidx.fragment.app.Fragment ? I'm using the dagger-android framework to inject my dependencies in my code. As the documentation says I do this to inject my fragment @Override public void onAttach(Activity…
Irving Dev
  • 389
  • 2
  • 8
21
votes
5 answers

Cannot resolve symbol repeatOnLifecycle in Android

I'm following this article to collect flows in UI. But I couldn't resolve repeatOnLifeCycle API in my code. I have added the below dependency, though. lifecycle:lifecycle-runtime-ktx:2.4.0-alpha03 Please help
Rakesh
  • 1,205
  • 1
  • 14
  • 33
21
votes
4 answers

No super method getLifecycle() after migrating to androidx

I have been trying to migrate my app to use androidx but I seem to encounter a strange error. From my activity which extends AppCompatActivity when I call getLifeCycle() it throws the following exception Caused by: java.lang.NoSuchMethodError: No…
Abdullah Razzaki
  • 972
  • 8
  • 16
21
votes
4 answers

Programmatically create a MaterialButton with Outline style

I would programmatically like to create a button as defined in the design guidelines here: https://material.io/design/components/buttons.html#outlined-button, looking like this: In XML I'm able to do this, using this piece of layout…
Peter
  • 10,910
  • 3
  • 35
  • 68
21
votes
3 answers

Androidx modules, android:attr/ttcIndex & android:attr/fontVariationSettings not found

I'm migrating all my support/appcompat libraries to androidx. After all updates I can't build my project because of this error :app:processDebugManifest UP-TO-DATE AGPBI: {"kind":"error","text":"error: resource android:attr/fontVariationSettings not…