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
12
votes
1 answer

i updated my existing project to androidx but got ExampleInstrumentedTest--> getTargetContext error

When I updated my project to androidx then I've got following error I also searched but can't find my answer, although project works fine @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void…
Muhammad Arslan
  • 939
  • 8
  • 13
12
votes
6 answers

androidx Navigation: Too many arguments for @NonNull public open fun

I am using Navigation Editor in Android Studio to implement Safe Args. I am accepting arguments in one fragment as
12
votes
0 answers

Dependencies using groupid com.android.support and androidx.* can not be combined but found IdeMavenCoordinates

I want to upgrade Google libraries: build.gradle (app): dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}" implementation…
CoolMind
  • 26,736
  • 15
  • 188
  • 224
12
votes
4 answers

OnBackPressedCallback is being called, but app is not going back

I recently updated my dependencies to include the OnBackPressedCallback change from an interface into an abstract class. I have set things up according to the new documentation here but I feel like things are not working as they should. My…
12
votes
4 answers

How to make BiometricPrompt non-cancelable?

I am using BiometricPrompt in my application. It works well and shows the dialog when call the authenticate() method. But this dialog gets closing when I click outside the dialog. How to prevent it? How to make BiometricPrompt's dialog…
BArtWell
  • 4,176
  • 10
  • 63
  • 106
12
votes
3 answers

Android crashed after updating androidx biometric to 1.0.0-alpha04

Everything works fine with 'androidx.biometric:biometric:1.0.0-alpha03', however when I build my project with the latest 'androidx.biometric:biometric:1.0.0-alpha04' and call myBiometricPrompt.authenticate(promptInfo) it throws this exception:…
12
votes
4 answers

Cannot invoke observe on a background thread

I just upgraded to AndroidX and after doing that all my request. I make in background thread do not run but come up with this error. private void getContactsList() { Task.callInBackground((Callable) () -> { …
QuCoon Team
  • 121
  • 1
  • 1
  • 5
12
votes
4 answers

Android X + Truth + Guava test compile issue

I have an Android library (called api) gradle module as part of a larger project. I just migrated the whole project to AndroidX. I now have this error when running instrumentation test on the api lib: Task :api:checkDebugAndroidTestDuplicateClasses…
tir38
  • 9,810
  • 10
  • 64
  • 107
12
votes
3 answers

Type mismatch: inferred type is LoginActivity but LifecycleOwner was expected

I am playing with the preview version of AndroidStudio - 3.4 Canary 9. I selected the default login activity option from Configure your project window and provided, selected below options: No error reported on Gradle sync, however on build…
12
votes
4 answers

SetupWithNavController does't work for toolbar

I am trying to bind toolbar to navigation controller, for that I am using the following code: NavigationUI.setupWithNavController(toolbar, NavHostFragment.findNavController(nav_host)) and in the menu file, I provided the id of the fragment to which…
user5699130
12
votes
7 answers

OutlinedBox for TextInputEditText is not working

I am working on login screen where I want to implememt material edit text with following view : Following is my code :
12
votes
1 answer

androidx.core:core-ktx:1.0.0 widget package missing

Recently Android team(mainly those guys actually) had introduced androidx.core:core-ktx:1.0.0. I've added it to mine project : implementation 'androidx.core:core-ktx:1.0.0' Everything looks cool, despite few moments - I can't find the toast()…
Yurii Tsap
  • 3,554
  • 3
  • 24
  • 33
12
votes
1 answer

Why Can't I import PreferenceFragmentCompat using AndroidX library?

I'm trying to set up my SettingsFragment but import PreferenceFragmentCompat hasn't been working. Is there a way of doing this with AndroidX? Dependency implementation 'androidx.preference:preference:1.0.0-rc02' Gradle flie apply plugin:…
Ismail
  • 445
  • 1
  • 5
  • 20
12
votes
3 answers

Migration to androidX - can't import/find androidx.databinding.DatabindingUtil

I'm working on an Android MVVM application. I just switched to the androidx libraries manually. This are the libraries in my build.gradle: implementation 'com.google.code.gson:gson:2.8.5' implementation fileTree(dir: 'libs', include:…
476rick
  • 2,764
  • 4
  • 29
  • 49
11
votes
2 answers

Baseline Profiles x R8/Proguard

I've been experimenting with Android's Baseline Profile & MacroBenchmark libraries for improving the app performance. The question I have is that it is suggested that the MacroBenchmark's build-types be as close to the release build but with…
Darshan
  • 4,020
  • 2
  • 18
  • 49