just a follow-up because I was searching for the same thing - and the answers here are outdated - lately the base proguard config is here in the sdk dir - so you only have to put this into your project.properties:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt
if you want to make project-specific modifications, create a proguard-project.txt and change the line to:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
like this for classes, also can apply for members and fields
-keep public class <className with pakage>
-keep class retrofit2.** { *; }
-For Warning : You need to take a look on stacktrace to find which classes gives those warnings,
-dontwarn <classes_name>
-dontwarn retrofit2.**
-dontwarn java.nio.file.*
-dontwarn okio.**
then put these lines in your app’s (module) ‘proguard-rules.pro’ file
**Like this:**
[![enter image description here][1]][1]
**In **build.gradle** :**:
[![enter image description here][2]][2]
[1]: https://i.stack.imgur.com/aCPIyZcfOj.png
[2]: https://i.stack.imgur.com/4HzqPoTMQf.png
Present in both answers;
Present only in the new answer;
Present only in the old answer;