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

MaterialDatePicker not working on Android

I want to change the date picker of my project to the date picker provided by the Material Components for Android, but it is not working. This is the code I've tried: MaterialDatePicker.Builder builder =…
13
votes
5 answers

Delete EncryptedSharedPreferences with clear() not working

I use the EncryptedSharedPreferences from the androidx.security:security-crypto:1.0.0-alpha02 lib to store some Tokens. If i use prefs.edit().remove("token")).apply() or prefs.edit().remove("token")).commit() the token is removed. But if i try to…
elpatricko
  • 488
  • 5
  • 17
13
votes
4 answers

DialogFragment ignores OnBackPressedDispatcher

I'm trying to handle the back button in a BottomSheetDialogFragment, which is a DialogFragment, using 'androidx.activity:activity-ktx:1.1.0-alpha01' and 'androidx.fragment:fragment-ktx:1.2.0-alpha01'. handleOnBackPressed() is not called and the…
David Corsalini
  • 7,958
  • 8
  • 41
  • 66
13
votes
1 answer

Why Dialog does not have a NavController [Missing]?

I am trying to use the latest update of Nav Component in my application where i can add dialog(BottomSheetDialogFragment) in my nav graph nav_version = "2.1.0-alpha05" Part of code from my nav_graph:
13
votes
4 answers

After migrating to AndroidX application crashes with Attempt to invoke androidx.fragment.app.FragmentManagerImpl.isDestroyed() on a null ref

The full stack includes only android core code: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.fragment.app.FragmentManagerImpl.isDestroyed()' on a null object reference at…
Mircea Slimu
  • 651
  • 5
  • 10
13
votes
4 answers

androidX jetifier - Is there a way to ignore jetifying a .JAR?

Trying to update my app to androidX dependencies. Followed instructions here, and compilation failed. The error came from JetifyTransform task failing to process a certain .JAR dependency (FYI - Samsungs Spass SDK) : FAILURE: Build failed with an…
Mardann
  • 1,953
  • 1
  • 16
  • 23
13
votes
6 answers

Didn't find class “androidx.multidex.MultiDexApplication” on path: DexPathList on lower API <= 19 devices

I'm trying to add Multidex support to my app. But I get an error: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo: java.lang.ClassNotFoundException: Didn't find class "androidx.multidex.MultiDexApplication" on path:…
Vladyslav Panchenko
  • 1,517
  • 1
  • 19
  • 23
13
votes
2 answers

Adding horizontal scrolling to chip group in Relative layout

I created few static chips in a group. I'm using this link (https://material.io/design/components/chips.html#) as reference. Code is as given below:
Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
13
votes
4 answers

Passing arguments in BottomNavigationView with navigation Component

I'm currently writing an app with the new (to me) navigation component. I've got the basics down with a single navigation graph to navigate around my app, I've got a fragment with a BottomNavigationView in which has 3 seperate fragments, I've…
Daniel Sims
  • 531
  • 4
  • 21
13
votes
9 answers

Why is butterknife 9.0.0-SNAPSHOT not resolving?

I want using AndroidX library and below is my Gradle setup for Butterknife app:module Dependency implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT' annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT' Plugin apply…
Ismail
  • 445
  • 1
  • 5
  • 20
12
votes
3 answers

onActivityResult is deprecated how do I send startResolutionForResult

So I'm using a gps class to turn on the gps and here's a method that allow us to send to onActivityResult, but since is deprecated on AndroidX and still available, android team recommend us the next: it is strongly recommended to use the Activity…
Barrufet
  • 495
  • 1
  • 11
  • 33
12
votes
3 answers

How to run particular transition in MotionLayout?

I have a MotionScene with 4 ConstraintSets representing 4 states of screen (loading states) and with 3 Transitions between them. When my app state changes from e.g. loading to processing, I want to run Transition 1 (set1 -> set2), when state changes…
12
votes
4 answers

Fragment NavHostFragment did not create a view

I couldn’t catch this problem personally, but there are a lot of such errors on Firebase Crashlytics I tried all the answers with StackOverflow but nothing helped My R.layout.activity_main
Pavlo Kravchenko
  • 345
  • 5
  • 20
12
votes
2 answers

When to use MaterialToolbar and androidx Toolbar and the difference between both?

When i switched to AndroidX i found that the Toolbar has moved to androidx.appcompat.widget.Toolbar also there is a new MaterialToolbar introduced as com.google.android.material.appbar.MaterialToolbar What is the difference between these two and…
12
votes
7 answers

takePicture require executor on CameraX (1.0.0-alpha06)

After update from androidx.camera:camera-core:1.0.0-alpha03 to androidx.camera:camera-core:1.0.0-alpha06 signatures of methods setTargetAspectRatio (in ImageCaptureConfig.Builder) and takePicture (in ImageCapture) have been changed. Official…
Peter Staranchuk
  • 1,343
  • 3
  • 14
  • 29