Click File -> Settings (or click Ctrl + Alt + S) and find File Encodings in your Android Studio. See the image below as a reference.
Now you have three options
- Change project encoding to match UTF-8 since both Gradle and
Android Lint use this (recommended),
- or change IDE encoding to match other encoding,
- or just simply ignore the warning. If it worked out for you so far, it will continue to work anyway
Once you see the warning, you can directly click on “Open File Encoding Settings” as shown in the image below. This will take you to the same place as described above.
You can also see the current encoding of your file at the bottom right corner of Android studio. You can also change it there. See the image below.
Also you can specify charset in your build.gradle script like this
According to Ashl7’s comment, you need to do a gradle sync for this to work