简体   繁体   中英

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?

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.

Just create the config file in your project. When you do a release build (build | generate signed apk) you can choose to run proguard and choose this configuration file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM