Reputation: 5260
I have written a library that supports AndroidX
.
How can I use this library with migration if I don't want to migrate my project to AndroidX yet?
Upvotes: 1
Views: 267
Reputation: 5165
You could try the jetifier-standalone in reverse mode, to provide build with support libraries. Therefore you'd have 2 releases of the library - androidx and support lib.
Upvotes: 1
Reputation: 4956
Many popular libraries that have supported AndroidX say something like "If you wish to use this library now, migrate to AndroidX or use old versions". So I don't think you can use an AndroidX library with an non-AndroidX project.
Support libraries and AndroidX have different package name space. In the future, new changes in the AndroidX libraries won't be available in the support libraries.
Migrate the project to AndroidX or downgrade the library to support library.
Update
As mlyko's comment mentioned, jetifier has a reverse mode:
https://developer.android.com/studio/command-line/jetifier#reverse_mode
In this mode, the utility converts AndroidX APIs to the support library equivalents, instead of the other way around. Reverse mode is useful, for example, if you are developing libraries that use AndroidX APIs, but also need to distribute versions that use the support library.
I haven't tried it but it seems promising.
Upvotes: 3