0

So in my project, we are overriding a preferences layout file - preference_category_material.xml from androidx.preference:preference library.

Our new code of preference_category_material.xml looks something like this

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="UnusedResources"
    android:id="@android:id/textView"
    ...
    />

The TextView is the root and the only element in the file.

While running ./gradlew lintRelease I am getting this error:

Error: Overriding @layout/preference_category_material which is marked as private in androidx.preference:preference:1.2.0. If deliberate, use tools:override="true", otherwise pick a different name. [PrivateResource]

I have seen a similar question, but that deals with color tags: Override resources in library android

Adding tools:override="true" to the TextView in our file does nothing.

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="UnusedResources"
    tools:override="true"
    android:id="@android:id/textView"
    ...
    />

This does not solve the problem.

Any help is appreciated. Thanks.

SayantanRC
  • 799
  • 7
  • 23

0 Answers0