Android Studio complains about unused code in library project

Viewed 48

I have a Android gradle library project of type "com.android.library".

Of course there are many methods/classes/... which aren't used because they aren't called from within the library itself. But they will later be called from my application which depends on the library.

So when I open a .java file from my library in Android Studio I will get warnings in the "Current File" tab.

They look like this:

Class '*' is never used
Method '*' is never used
Field '*' is never used
Constructor '*' is never used

I think Android Studio just doesn't understand that this is a library project.

I don't want to put thousands @SupressWarning("unused") into my code. How to fix these warnings?

0 Answers
Related