Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

com.android.support:design:28.0.0 - Version 28 is the last version of the legacy support library

In my android project in xml I try to use com.google.android.material.textfield.TextInputEditText

like this:

        <com.google.android.material.textfield.TextInputEditText
                android:id="@+id/editTextEmail"
                style="@style/textTextViewStyle"
                android:layout_width="0dp"
                android:layout_height="@dimen/min_height"
                android:layout_margin="@dimen/default_margin"
                android:hint="@string/email"
                android:inputType="textEmailAddress"
                android:padding="@dimen/half_default_margin"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewAppName" />

in gradle.properties

android.useAndroidX=true
android.enableJetifier=true

In app/build.gradle:

android {
    dataBinding {
        enabled = true
    }
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.myapp"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

but I get warning in this line:

implementation 'com.android.support:design:28.0.0'

Warning message:

Version 28 is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries...

How I can fix this?

like image 611
Alexei Avatar asked Sep 07 '19 15:09

Alexei


People also ask

Is the last version of the Legacy support library so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward?

Version 28 is the last version of the legacy support library, so we recomand that you migrate to AndroidX libraies. Save this question. Show activity on this post. what do you think it means?

Should you use legacy Android support libraries?

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well. So all Android apps should now aim to use AndroidX, instead of the old support library.

How do I update my Android library?

Update the Android Support LibraryIn Android Studio, click the SDK Manager icon from the menu bar, launch standalone SDK Manager, select Android Support Repository and click “Install x packages” to update it. Note you will see both Android Support Repository and Android Support Library listed in the SDK Manager.

What is Android legacy support?

If you need to monitor old versions of Android, you can use legacy versions of the Android agent: To support Android versions lower than 4.0, use version 5.19. 1 or earlier of the Android SDK. This is referred to as the legacy version. To support Android 2.2 specifically, use version 4.244.


1 Answers

To use components like <com.google.android.material.textfield.TextInputEditText you have to add the Material Components library:

implementation 'com.google.android.material:material:1.1.0-alpha10'

and remove the design support library

//implementation 'com.android.support:design:28.0.0'
like image 113
Gabriele Mariotti Avatar answered Oct 27 '22 00:10

Gabriele Mariotti