Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Proguard in Android Studio?

As we can configure Proguard settings in progaurd.cfg, is there a way to configure it in Android Studio? And if so, how?

like image 590
Aexyn Avatar asked Aug 14 '13 20:08

Aexyn


People also ask

What is ProGuard config file in Android Studio?

The proguard-rules.pro file is where you can add custom ProGuard rules. By default, this file is located at the root of the module (next to the build. gradle file).

Where is ProGuard in Android Studio?

Android Studio adds the proguard-rules.pro file at the root of the module, so you can also easily add custom ProGuard rules specific to the current module. You can also add ProGuard files to the getDefaultProguardFile directive for all release builds or as part of the productFlavor settings in the build.


1 Answers

If you're using the Android Studio build system (not Gradle), these are the steps to take:

  1. Open the project structure window
  2. Select "Facets" under Project Settings, and then select the Android facet for the project in which you want to run proguard
  3. On the right side of the screen you should see 4 tabs: Structure, Generated Sources, packaging, and ProGuard
  4. Select the ProGuard tab and configure your project to point to the proguard configuration file

To actually modify the ProGuard settings themselves in Android Studio, you might consider adding the proguard configuration file into the project. You can edit it as you would any other text file.

like image 90
Software.Developer Avatar answered Oct 11 '22 12:10

Software.Developer