Reputation: 1418
Below in the image 1 you can see I created a Kotlin class that extends from the Application() class:
I also added the necessary stuff in my Manifest file as you can see in the next image:
However I can't figure out why Android Studio maintains that I am NOT using my Class at all! It is underlined and grayed out and on mouse over you see the message "Class XZY is never used."
The same behavior I noticed in Versions of Android Studio different from my current one, which is 3.1.2. Of note might be that if I create the same class in Java, Android Studio functions as it should and knows that I use the class if I mention it in my Manifest file. Any ideas how to convince the Android Studio that I am actually using this class?
Upvotes: 11
Views: 1575
Reputation: 464
That is bug and it's not yet solved what i did was adding this line before the class
@Suppress("unused")
Upvotes: 1