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?
That is bug and it's not yet solved what i did was adding this line before the class
@Suppress("unused")
This is a bug in Android Studio. Here is a link to Google Issue Tracker (requires Google account). It was reported there by a few users in March 2018 and got little attention from Google staff ever since.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With