How do I disable proguard for building my Android app?
Try to delete the proguard directory in your project. So proguard will forget its mapping.
How to enable proguard for only one module
The solution is to look up for the methods and classess that needs to be exempted and add them to the proguard rules as follows..
-keep class com.mm.** {*;}
-keep class com.company.** {*;}
-keepclassmembers class com.mm.** {*;}
-keepclassmembers class com.company.** {*;}
How to disable Proguard settings for an external dependency jar?
It's not possible at the moment to exclude a dependency when running ProGuard.
You should only proguard the library if you want to obfuscate parts of it. This is only really useful if you want to only offer part of it as a public API. You definitively do not want to remove dead code, since you don't know what will get used or not.
On the app side, you probably don't need to put anything special, unless the library code requires you to not obfuscate some specific class. If that's the case you should actually publish this from the library so that the app uses that automatically. There's a sample called
libProguardConsumerFiles
that shows how to do this using theconsumerProguardFiles
properties. This will include a proguard rule file in the library packaging that will get used by whomever consumes the library.
Enable/disable ProGuard in the product flavor
For your scenario, it feels like you are trying to model different phases of your development lifecycle. That's really where build types are for. While Gradle (and hence Gradle for Android) ships with debug
and release
build types, you can define your own:
buildTypes {
debug {
applicationIdSuffix ".d"
versionNameSuffix "-debug"
}
release {
signingConfig signingConfigs.release
}
mezzanine.initWith(buildTypes.release)
mezzanine {
applicationIdSuffix ".mezz"
debuggable true
}
}
Here, I:
Configure the
debug
andrelease
build typesClone a
mezzanine
build type fromrelease
Override some settings on
mezzanine
, replacing what they had been defined as originally onrelease
Related Topics
How to Find the Android Version Name Programmatically
How to Create and Save a Screenshot from a Surfaceview
How to Add Code Obfuscation for My Android Application
Get Response Status Code Using Retrofit 2.0 and Rxjava
Estimating Beacon Proximity/Distance Based on Rssi - Bluetooth Le
Android: Why Must Use Getbasecontext() Instead of This
Create a Chatview Layout in Android
Android Translate Animation - Permanently Move View to New Position Using Animationlistener
Capture Picture Without Preview Using Camera2 API
Android - Way to Appear Bordered Text on the Textview
Nexus 5X Reverse Landscape Sensor Fix in a Android Camera Preview App
Android - Margins Specified in Custom Style Not Taking Effect
Call Getlayoutinflater() in Places Not in Activity
How to Stop an Animation (Cancel() Does Not Work)