My build.gradle has . . .
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
Every proguard-android.txt file I can find (like the one at C:\Users\Gary\AppData\Local\Android\sdk\tools\proguard) has the following in it:
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /tools/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
This seems to be nonsense because there is no project.properties file in AS projects that I can find. The only thing that I can see being changed in my .apk is local names and nothing else. Where do I put my proguard parms? thanks, Dean
You should put the
proguard-rules.txt
underapp/
(i.e. the same level asapp/build.gradle
). The text at the top of the default proguard files is a comment (see that the first character in each line is#
). You can add your custom rules below the comment, or delete the comment all together.As stated in the commented text in the top of default proguard files, you can find more documentation here.