Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

proguard.cfg file missing

Tags:

Reading the docs on proguard . . . android docs

I'm supposed to have a ProGuard.cfg as it says... "When you create an Android project, a proguard.cfg file is automatically generated in the root directory of the project. "

If I google the issue there are answers all over the place most of them saying to modify a file that starts with a warning not to modify the file.

Are the docs out of date? How to I get this enabled for release builds? thanks, Gary

like image 643
Dean Blakely Avatar asked Jan 24 '13 23:01

Dean Blakely


People also ask

Where is ProGuard CFG?

Android will be sufficient to remove all (and only) unused code. To view the default ProGuard configuration, open the file at obj\Release\proguard\proguard_xamarin. cfg.

Where do I put ProGuard file?

You can manually create the file in the \StudioProjects\your_project\app folder and you can add the custom rules.

What is ProGuard configuration?

ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.


1 Answers

If you're using ADT 17 or newer, the documentation is slightly inaccurate. The generated file is proguard-project.txt and will be in the root directory of your project.

To enable Proguard, you will need to ignore the "do not modify" warning in project.properties and uncomment the following line:

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 

The Android toolchain will sometimes make changes to project.properties, but your Proguard path will be preserved.

like image 172
acj Avatar answered Sep 19 '22 17:09

acj