You need to find out if you want to
- Run proguard in the library
- Launch proguard in the app (Hint: this is it.)
Run proguard in the library
This is DO , it reaches the application. The rules of your proguard library are responsible for ensuring that all available and accessible codes are available, but you can confuse inner classes.
Here is the build.gradle library:
android { defaultConfig { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } buildTypes { release { minifyEnabled true // Yes, run proguard on the library itself. } } }
If you release this library as open, you will not need it. If you do not publish the library to the public, you do not need it.
I get errors that packages / characters from the library cannot be found.
Proguard builds a dependency graph between classes. The library is currently a standalone unit, so if you haven't specified any rules, none of the classes are ever used, so proguard deletes them all.
Run proguard in the application
Let the consumer (application) know which library classes should be stored.
Here is the build.gradle library:
android { defaultConfig {
How proguard works
You need to tell proguard which code to keep and which names to keep. Proguard removes all unused code names and scrambling that you did not want to stick with.
You do not tell proguard what to remove, you tell proguard what to save.
Eugen pechanec
source share