Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is proguard-rules.txt in android studio?

In my demo project, proguard-rules.txt is not available in Android studio.

I must be missing some code :

enter image description here

Where can I find proguard-rules.txt file?

I want to add proguard rules

Any help is appriciated

Thank you

like image 568
Kushal Avatar asked Jul 29 '15 07:07

Kushal


People also ask

Where is ProGuard rules file?

Android Gradle Plugin provides us two different ProGuard rules config files which are located under build/intermediates/proguard-files .

Where to find this ProGuard-Android optimize txt?

The getDefaultProguardFile() refers default file “proguard-android. txt” which gets from the Android SDK tools/proguard/ folder. You can also use “proguard-android-optimize. txt” file for more code shrinking located on the same folder.

What is ProGuard-Android txt?

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.


2 Answers

Looks like your project is missing proguard files. You can add it yourself: put the proguard-rules.txt file into the app directory. It's already added to your build.gradle file so no further actions required.

like image 175
aga Avatar answered Oct 18 '22 18:10

aga


proguard-rules.txt (or proguard-android.txt) are in your SDK folder, but if you want to add something to your ProGuard rules you should do this in proguard-rules.pro.

This file should be automatically added to your project by Android Studio when you create new (if isn't present - create manually). Check DOC (Gradle section ofc)

like image 9
snachmsm Avatar answered Oct 18 '22 18:10

snachmsm