In my demo project, proguard-rules.txt
is not available in Android studio.
I must be missing some code :
Where can I find proguard-rules.txt file?
I want to add proguard rules
Any help is appriciated
Thank you
Android Gradle Plugin provides us two different ProGuard rules config files which are located under build/intermediates/proguard-files .
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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With