I need to use shrinkMode = "strict"

790 views Asked by At

I need to use shrinkMode(strict).

I created a file keep.xml in category res/raw/keep.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources                          
xmlns:tools="http://schemas.android.com/tools"            
tools:shrinkMode="strict" />

This does not work. But I don't know what to do next.

1

There are 1 answers

0
KeLiuyue On

You should set shrinkResources true in your build.gradle(app) .

And create file like res/raw/keep.xml

android {
    ...
    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
        }
    }
}