Jaime Montoya
Jaime Montoya

Reputation: 7701

How to know which Support Library version my Android app is using?

In my gradle.properties I have this:

android.useAndroidX=true

When I Make Project, I get BUILD SUCCESSFUL. From Android Studio, I go to Refactor > Migrate to AndroidX... I am getting 15 references in 9 files to be changed:

enter image description here

Reading https://medium.com/androiddevelopers/migrating-to-androidx-tip-tricks-and-guidance-88d5de238876, I see that the step 1 of the recommended approach to migrate is to Update to Support Library version 28. In order to do that, I want to know what Support Library version the code of my app is at. Where can I see that? In some of my .java files I have found the following:

import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v4.content.ContextCompat;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.support.multidex.MultiDex;

In my app\build.gradle I have this: implementation 'com.android.support:multidex:1.0.3'.

Do any of the lines above reveals or helps to reveal the Support Library version that the code of my app is at? Thank you.

Upvotes: 0

Views: 485

Answers (1)

TheLibrarian
TheLibrarian

Reputation: 1888

What it means is that they suggest upgrading all of the possible support libraries to 28.0.

Those are basically anything that starts with com.android.support:

e.g.:

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'

The recommendation there is so the migration in the AS will have to do minimal guessing on how to migrate it.

So to stricly answer your question, the version you use is the version you have in gradle.files.

Upvotes: 1

Related Questions