To enable ProGuard in Android Studio.
Below is the sample how to enable default ProGuard in Android Studio.
- Go to the build.gradle file of app
- enable the minifyEnabled true
- enable shrinkResources true to reduce the APK size
-
proguardFiles getDefaultProguardFile('proguard-android.txt')
to enable the default one. If you want to use your own proguard file then use the below rules.buildTypes { release { debuggable false minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { debuggable true minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
The link with ProGuard settings for Android and other settings are available in these links:
For more detail go through this link