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

Why Android Studio is forcing to use Androidx from Android support library?

Working on a React Native project but out of sudden it stopped working & started giving an error: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from…
Mohsin
  • 1,586
  • 1
  • 22
  • 44
17
votes
4 answers

Display back button on toolbar on first screen of navigation graph

I'm trying out androidx navigation component and have setup my activity with a toolbar a container. I'm doing this in one of the intermittent screens of my app which has a lot of internal navigation/steps and I thought I could navigation arch…
17
votes
4 answers

Required lifecycle owner found Activity

I am using android library androidx.appcompat:appcompat:1.0.2. Working on a sample of codelabs work manager. I need to get live data from ViewModel and I am using this mViewModel!!.getOutputWorkInfo()?.observe(this, Observer> { …
17
votes
4 answers

How to handle notch(display cutout) in android API lower than 28?

Android added notch support on API 28, but how to handle it on devices running API 27 (Honor 10, Huawei P20, etc.) ? I was trying to use DisplayCutoutCompat but I was not able to create an instance of it since documentation does not really point…
blade
  • 804
  • 1
  • 9
  • 18
16
votes
9 answers

I'm getting the "AndroidX dependencies" error with android.useAndroidX enabled

I am getting the following error while trying to build my android app: Task :app:mergeDebugResources FAILED FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:mergeDebugResources'. This project uses…
Aurumque
  • 429
  • 1
  • 4
  • 8
16
votes
3 answers

Cannot access 'androidx.activity.result.ActivityResultCaller'

I'm using androidx for quite a while and my Android project compiles fine, however recently my Android Studio throws tons of red for all Activity classes because of cannot access 'androidx.activity.result.ActivityResultCaller' which is a…
Adam Styrc
  • 1,517
  • 2
  • 23
  • 38
16
votes
2 answers

Can't use android.support.v7.widget.Toolbar with android.useAndroidX=true

in app/build.gradle: implementation 'com.android.support:appcompat-v7:28.0.0' in my activity I use import android.support.v7.widget.Toolbar Nice. It's work finde. But when I migrate to androidx I add…
16
votes
2 answers

Cannot find a version of 'androidx.arch.core:core-common' that satisfies the version constraints

With a new Android Studio project created (Empty Activity type), if you add the following lines: // Lifecycle/View Models def lifecycleVersion = '2.0.0' implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion" …
Zach
  • 3,909
  • 6
  • 25
  • 50
16
votes
5 answers

Unable to get provider androidx.lifecycle.ProcessLifecycleOwnerInitializr

Getting error while running app which have dependencies 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03' and 'androidx.lifecycle:lifecycle-viewmodel:2.1.0-alpha03' on device with Android 4.4. Works fine in device with Android 6 App getting…
Ajay Simiyon
  • 461
  • 1
  • 4
  • 9
16
votes
4 answers

Didn't find class "androidx.core.content.FileProvider"

I migrated my app to AndroidX and it's crashing on launch on API level 21. My application throws this exception: 10-08 09:42:50.930 11346-11346/com.example.test E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.test, PID:…
15
votes
3 answers

androidx getFragmentManager() has been deprecated

Getting deprecation warnings for androidx.fragment.app.Fragment: warning: [deprecation] getFragmentManager() in Fragment has been deprecated. What to do?
15
votes
4 answers

Error inflating class android.webkit.WebView on android 5

I got the following error testing on Android 5.0 (API 21). Tested on other OS versions works well. java.lang.RuntimeException: Unable to start activity …
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
15
votes
5 answers

AAPT: error: resource android:attr/android:progressBarStyleSmall not found

C:\Users\Admin.gradle\caches\transforms-2\files-2.1\9f39f95ecc02dcabb161a6205cd680b4\jetified-magicretry-1.0.6\res\layout-v11\magicretry_fragment.xml:121: AAPT: error: resource android:attr/android:progressBarStyleSmall not found. I am using…
sandeep kolhal
  • 393
  • 1
  • 4
  • 14
15
votes
3 answers

How to get a default string value from resources in SafeArgs?

I'm just learning a Android NavigationUI, and try set a toolbar title using string default value from Safe Args. But have some problem about it. 'String resources' file: Add new items Navigation graph…
15
votes
1 answer

Flutter plugin: InAppPurchasePlugin.java uses unchecked or unsafe operations

When i am trying to just add the in_app_purchase plugging in the apps pubspec.yaml file the following error is occurred. Just after adding the plugin. not related to any specific code. Note:…