ShanieMoonlight
ShanieMoonlight

Reputation: 1861

Android targetSdkVersion

I've set my targetSdkVersion to 29 in build.gradle and now I'm getting the following lint error:

"Redundant attribute layout_marginLeft; already defining layout_marginStart with targetSdkVersion 29"

on this TextView:

        <TextView
                android:id="@+id/description"
                style="@style/TextAppearance.MaterialComponents.Headline6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginLeft="16dp"
                android:text="@{dto.description}" />

My question is, if I do what is recommended and remove layout_marginLeft from the TextView will this cause problems on phones running an sdk less than 29?

Upvotes: 1

Views: 540

Answers (1)

shmakova
shmakova

Reputation: 6426

If your minSdk = 16, you should keep android:layout_marginLeft, otherwise you can remove it.

Upvotes: 1

Related Questions