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
15
votes
14 answers

Error inflating class com.google.android.material.navigation.NavigationView after migration to AndroidX

After I updated my project to AndroidX with targetSdkVersion set to 28, my project crashes when installing it from the store for beta testing. The following is the error log I receive: 2019-07-08 08:28:33.026 32011-32011/? E/AndroidRuntime: FATAL…
Tankos
  • 181
  • 1
  • 1
  • 8
15
votes
1 answer

flutter import android.support.annotation.NonNull

So, I wanted to use firebase_auth in the flutter, but I was having androidX.annotation.NonNull error I made a few changes in android files and after a lot of jumble mumble I fixed the error but now I get…
Raj Dhakad
  • 852
  • 2
  • 17
  • 39
15
votes
2 answers

Architecture Navigation Component : onCreateView gets called every time

Everytime fragment instance is created and reloading when you press back. How to overcome this issue? Inability of having proper backstack in nav controller is a huge productivity issue. Hope it's a missing feature or a work-around made on…
15
votes
5 answers

ERROR: [TAG] Failed to resolve variable '${project.version}'

I am a beginner in android so please explain me your answers. I've been trying to use ButterKnife but I faced some problems. I checked many answers which recommended migrating to androidx. I did so, but I faced many other errors. Actually, when I…
Noussa
  • 520
  • 1
  • 4
  • 14
15
votes
1 answer

Robolectric AndroidX fragments NoClassDefFoundError

After migration of code and tests to AndroidX, all seems to work pretty well, however Robolectric junit tests for two fragments are failing due to NoClassDefFoundError: androidx/fragment/testing/R$style exception. The stack…
Marcin Bak
  • 1,410
  • 14
  • 25
15
votes
3 answers

PagedListAdapter.submitList() Behaving Weird When Updating Existing Items

Little story of this topic : the app just updating clicked row's values with dialog when confirmed. Uses pagination scenario on room database. When an item added or removed, the latest dataset is fetched and passed to submitList method, then all…
14
votes
2 answers

How to replace setTargetFragment() now that it is deprecated

setTargetFragment() is deprecated in Java, and I don't understand the correct replacement for it as android documentation uses it and is outdated. I believe the FragmentManager is the correct replacement for it. I am using the deprecated…
Tom
  • 717
  • 2
  • 6
  • 23
14
votes
2 answers

Dagger 2 androidx fragment incompatible types

I'm using Dagger 2.21 and when I try to do @Module internal abstract class FragmentModule { @ContributesAndroidInjector internal abstract fun loginFragment() : LoginFragment } and @Singleton @Component(modules =…
14
votes
3 answers

AndroidX.Test ActivityScenario: java.lang.AssertionError: Activity never becomes requested state "[RESUMED]" (last lifecycle transition = "STOPPED")

ActivityScenario is a replacement of ActivityController in Robolectric and ActivityTestRule in ATSL. When refactoring from ATSL to AndroidX Test, I am using this code to start my IndexActivity before each espresso test. @Before public void…
Mark Han
  • 2,785
  • 2
  • 16
  • 31
14
votes
5 answers

Fatal Exception: java.lang.IllegalStateException: Failure saving state: active fragment was removed from the FragmentManager

I recently changed my app to target API Level 28 and also started using androidx instead of support libraries. After the change, I'm noticing a crash that has the following traceback Fatal Exception: java.lang.IllegalStateException: Failure saving…
Arun Kumar Nagarajan
  • 2,347
  • 3
  • 17
  • 28
14
votes
13 answers

Data-Binding fails with "couldn't make a guess"

Since the update to Android Studio 3.2.0 I face the following issue: Execution failed for task ':mobile:dataBindingGenBaseClassesDebug'. > couldn't make a guess for com.ACME.database.model.Order also seen this answer, which hints for that…
14
votes
1 answer

Disable android.enableJetifier for specific module or depedency

Running Android Studio 3.2 with the following settings in my gradle.properties: android.useAndroidX=true android.enableJetifier=true I have a native project with some C/Java code. With these settings, the compilation fails with the following error…
l33t
  • 18,692
  • 16
  • 103
  • 180
14
votes
5 answers

Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

I know it could look like This Question but I could not fix it with the solution proposed and I could not comment on it too. The Error is : Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy Message{kind=ERROR,…
KerberosMorphy
  • 330
  • 1
  • 4
  • 14
14
votes
6 answers

Androidx and databinding

I'm migrating my dependencies for an Android P test to the androidx dependencies. For some not very clear reasons my project does not compile anymore (and no I won't provide the details to avoid a distinct problem). I found out (via gradlew…
13
votes
1 answer

LifecycleOwner: difference between Fragment (self) and Fragment#viewLifecycle

Using Android X and the Android Architecture Components, namely the following... Navigation Lifecycle ViewModel ... has made Android development much easier for better and more stable apps. When using a ViewModel exposing LiveDatas for a Fragment,…