question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't depend on unstable AndroidX libs

See original GitHub issue

flowbinding-recyclerview 0.11.1 currently depends on androidx.recyclerview:1.2.0-alpha02.

I think this is a mistake, as it transitively pulls in unstable libs the consumer may not want.

I propose a policy of never depending on unstable AndroidX library versions.

If this is a required use case, separate unstable artifacts could be published.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
ychescale9commented, May 28, 2020

Thanks for calling this out. I agree we should depend on stable versions of AndroidX for version 1.0.0 of the library.

The only reason I’ve been able to get away with using the alpha version of AndroidX dependencies is that we’re technically not API stable either.

In terms of binary compatibility and the effect of depending on non-stable AndroidX libraries:

  • AndroidX libraries won’t break backward compatibility without a major version bump (e.g. ViewPager2 which we have a separate artifact for)
  • FlowBinding’s artifacts use implementation to depend on the relevant AndroidX dependencies. ~This means consumers of FlowBinding need to explicitly bring in the dependency e.g. androidx.recyclerview in order to use a binding for that widget. Only the one specified explicitly by the consumer will be packaged into the apk.~ This was based on an invalid assumption that user doesn’t have any other library that transitively depends on the AndroidX lib in the classpath which is very wrong.
  • We are tracking binary compatibility of our public APIs using the binary-compatibility-validator plugin.

That said, since the bindings we provide don’t use any of those new APIs (maybe except for the material components bindings), there are no reasons to depend on an alpha / beta version of AndroidX.

Will try to address this soon.

1reaction
ychescale9commented, May 28, 2020

I don’t really want to rely on documentation to warn users about potential crashes 😅 . All the different versions of AndroidX and their transitive dependencies are already quite brutal for an average user.

I think we should probably just follow how AndroidX handles this. A stable release will just depends on stable release of transitive dependencies. User doesn’t need to know that what they’ve explicitly declared e.g. 1.0.0 has been overridden by a library’s transitive dependency 1.1.0, as they are both stable.

I’m not sure how to go about managing a separate non-stable release train 😂 . The AndroidX repo has a lot of custom plugins / tooling / process to support that which I don’t have.

I’ll look around a bit to see how other libraries handle this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stable AIDL | Android Open Source Project
Stable AIDL has the following key differences from AIDL: ... After adding stub libraries as a dependency to your module, you can include...
Read more >
Considerations when creating Android libraries - Medium
Libraries might depend on external dependencies, and ideally you want to deliver all of them within the same .AAR. Otherwise, the user will...
Read more >
Why does the sdk depend on RC versions of androidx artifacts?
The stripe sdk depends on unstable (release candidate) versions of some androidx artifacts. Looks like in commit 97c3ac3, for example, ...
Read more >
Unable to load class AndroidComponentsExtension after ...
If you don't have hilt dependency in your project the best way to find a library that throws the exception during gradle sync...
Read more >
build/aidl_interface.go - platform/system/tools/aidl - Git at Google
ModuleErrorf("depends on multiple versions of the same aidl_interface: %s", strings. ... version, the unstable version of the library in the VNDK.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found