CleverTap / clevertap-android-sdk

CleverTap Android SDK
MIT License
80 stars 74 forks source link

Migrate to androidx #38

Closed calvarez-ov closed 3 years ago

calvarez-ov commented 4 years ago

This sdk is still using the android support library, which is deprecated. Androidx has been out for quite a while now (over a year?). We'd like to remove jetifier from our app build process, but won't be able to until the sdks we use are on androidx.

darshanclevertap commented 4 years ago

Hi @calvarez-ov

We are still using the Android support library because moving to AndroidX will cause a breaking change for apps who have not yet migrated to AndroidX. Jetifier helps apps migrated to AndroidX deal with non-AndroidX dependencies (like us). The vice versa is not possible. If jetifier works for you right now, I'd suggest holding on to it for a few more months.

Out of curiosity, out of all the SDKs used by your app, how many have migrated to AndroidX?

calvarez-ov commented 4 years ago

In our project, two sdks haven't migrated to androidx yet: CleverTap and MapBox.

darshanclevertap commented 4 years ago

@calvarez-ov I will mark this as an enhancement and take this up internally with my team but I cannot promise you any timelines for now. Hope you understand. Be that as it may, you will be the first to know when we are planning to migrate to AndroidX. Thanks!

dtonybarajas commented 4 years ago

Hi, @darshanclevertap do you have some idea CleverTap can migrate to AndroidX. Because in my project I am using AndroidX and App inbox is not working it appears a message "Please upgrade com.android.support:design library to v28.0.0 to enable Tabs for App Inbox, dropping Tabs"

Thanks!

darshanclevertap commented 4 years ago

@tonybarajas We are still evaluating when to migrate to AndroidX. Meanwhile, for your App Inbox issue, I'd recommend adding the following two dependencies -

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'

Let me know if this works out for you!

dtonybarajas commented 4 years ago

Hi @darshanclevertap I added the two dependencies and the logs just says the same: Please upgrade com.android.support:design library to v28.0.0 to enable Tabs for App Inbox, dropping Tabs Note: I am still using android.enableJetifier=true android.useAndroidX=true

Do you know some workaround to be able to use App inbox with AndroidX? Thanks!

calvarez-ov commented 4 years ago

In our project, now mapbox has migrated to androidx.

That makes CleverTap the only sdk in our app that still hasn't migrated to androidx.

mochadwi commented 4 years ago

Waiting for this, to be officialy supported.

Meanwhile, I'm trying to host into internal private maven repository to change the actuals import package from support library to androidx instead, using jetifier-standalone from google

calvarez-ov commented 4 years ago

androidx has been stable for 1.5 years now. Can you please do the migration? Other projects who haven't migrated yet and are using CleverTap can continue to use the current 3.7.2 version of CleverTap. If they haven't yet migrated to androidx, they're probably used to using legacy versions of libraries anyway 😛 The rest of us can continue to use recent stable versions of all libraries without having to resort to workarounds like @mochadwi has started to do.

calvarez-ov commented 4 years ago

Chet Haase from Google says “it’s time” to migrate to androidx:

https://youtu.be/2ov_23fTwyU?t=2m45s

At 2:45 in the video.

mochadwi commented 4 years ago

really agreed @calvarez-ov more and more recommendation from google for the apps and library developer to migrate into AndroidX, especially Android 11 and above, and they will stop the support library, really waiting for this to come officially :)

mochadwi commented 4 years ago

Since reading this closed #43 regarding firebase messaging, seems that a lot of clevertap functionality replaced such as FcmTokenListener and InAppNotification due to still using Support Library and firebase (below 19.x)

@calvarez-ov @darshanclevertap

darshanclevertap commented 4 years ago

@calvarez-ov @mochadwi We cannot migrate to AndroidX till there is some official announcement of the deprecation of the older support libraries as we have more than 8000 clients and developers using our SDK. Not all of them have moved to AndroidX and since the jetifier method is available for now as a workaround for people who have chosen to migrate. Also @mochadwi your InAppNotificationActivity issue is something else and I've already replied on #68 .

calvarez-ov commented 4 years ago

The message from Googler Chet Haase saying the time is now, isn't enough?

calvarez-ov commented 4 years ago

The main page for the support library has a "DEPRECATED" watermark all over it: https://developer.android.com/topic/libraries/support-library :

image

It also says

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

calvarez-ov commented 4 years ago

Nick Anthony, Program Manager Android Jetpack, wrote an article a month ago saying "now is the time" to migrate to androidx: https://medium.com/androiddevelopers/migrating-to-androidx-tip-tricks-and-guidance-88d5de238876

Among the other reasons, the top one is:

The Android Support Library has reached the end of its life. 28.0 was the last release of the Android Support namespace and the namespace is no longer maintained.

hannesstruss commented 4 years ago

@darshanclevertap out of curiosity, how many of your clients using the SDK have not yet migrated to AndroidX? I'd assume this number is pretty low, would it make sense for you to fork and freeze the CleverTap SDK for these clients, backporting only important security fixes and making life easier for the majority of your clients?

mochadwi commented 4 years ago

@darshanclevertap out of curiosity, how many of your clients using the SDK have not yet migrated to AndroidX? I'd assume this number is pretty low, would it make sense for you to fork and freeze the CleverTap SDK for these clients, backporting only important security fixes and making life easier for the majority of your clients?

yes, backported for support library seems better (if there's bugfix) e.g in the latest supported AndroidX

calvarez-ov commented 4 years ago

I opened a ticket with Google to add the word "deprecated" in the text of the support library page (in addition to the existing big "DEPRECATED" watermark): https://issuetracker.google.com/issues/155005450

Their reply (sorry if it's a big aggressive...):

I don't understand what this is asking for. We won't be doing another Support Library release to @deprecate the classes -- there are no more Support Library releases.

The page is clear about the status of the Support Library:

You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

Regarding the reason,

Our project uses an SDK whose maintainers refuse to update to androidx until "there is some official announcement of the deprecation of the older support libraries"

That sounds like a thinly-veiled excuse to avoid doing the work.

abhimaanmadhav commented 4 years ago

@darshanclevertap still thinking of migration ? Being one our client we would strongly recommend you to migrate to androidX. if you have a few clients who are using support then maintain 2 sdk policy androidx,non androidx.

darshanclevertap commented 4 years ago

Hi guys, extremely sorry for the delay but I'm pleased to announce we have actively started working on the migration of our SDK to AndroidX support libraries. You can expect the AndroidX version to be out next month.

darshanclevertap commented 3 years ago

Hi guys,

We have brought AndroidX and Android 10 support in the CleverTap Android SDK v4.0.0. This is a major release so please check out the changes here which we have made before updating.

mochadwi commented 3 years ago

Thanks a lot for this @darshanclevertap