Jorge Leonardo
Jorge Leonardo

Reputation: 163

How to fix in android studio(The resource @drawable/abc_vector_test is marked as private in androix.appcompat:appcompat)

I have added this resource to my project and it shows me a warning. How can I solve it?

enter image description here

<resources>
         <public name = "drawable / abc_vector_test" />
     </resources>
The problem still continues (I don't know, if I did it wrong)

enter image description here

Following the suggested documentation (developer.android.com) I have created a file with the name public.xml and in this I have added the resource. Please ask me to explain it step by step since I am a beginner and the android studio documentation is not detailed.

Upvotes: 1

Views: 1507

Answers (1)

Shalu T D
Shalu T D

Reputation: 4039

Please follow the link to make public resource.

The resource @drawable/abc_vector_test is a private resource of androidX.appcompat:appcompat library and is intended to be used only by that library. You should not use it.

If you want to use it, copy that resource to your project.

OR

It's just a warning and it won't affect your project, you can disable the warning as below:-

In Gradle file

android {
    lintOptions {
        disable 'PrivateResource'
    } 
}

In XML:

tools:ignore="PrivateResource"

In Source code:

@SuppressLint("PrivateResource")

Upvotes: 1

Related Questions