GabrielBB
GabrielBB

Reputation: 2679

Can Android X Projects use library modules that are using support-library dependencies?

Let's say i have a public library module published to Maven Central and it is using the following dependencies:

implementation 'com.android.support:recyclerview-v7:28.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

Will this library work with no problems on Android X based projects?

Upvotes: 1

Views: 502

Answers (1)

ZumiKua
ZumiKua

Reputation: 506

Google has released a tool called Jetifier which migrates support-library-dependent libraries to rely on the equivalent AndroidX packages instead, so your libiary should work when Jetifier is enabled.

To enable Jetifier, make sure compileSdkVersion is set to API 28 or above and add the following lines in gradle.properties:

android.useAndroidX=true
android.enableJetifier=true

Upvotes: 1

Related Questions