Where is proguard-rules.txt in android studio?-ThrowExceptions

Exception or error:

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

How to solve:

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.

###

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)

###

it is located under your sdk folder, usually in yoursdk/tools/proguard/. If you are using linux or mac, once you cd into the sdk folder you can run

find . -iname proguard-rules.txt

to look for it

###

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

Leave a Reply

Your email address will not be published. Required fields are marked *