Skip to content

Shrink, obfuscate, and optimize your app


For obfuscation and resources optimization, use

minifyEnabled true
shrinkResources true

Make sure to add the following exclusion rules to app/

-keep public class com.huawei.hms.mlkit.face.** { *; }
-keep public class**

In case the Huawei Vision dependency is used, add the following exclusion as well:

-keep public class com.regula.huaweivision.** {
    public *;

To the resources/raw/keep.xml resources file, add

<resources xmlns:tools=""
    tools:shrinkMode="strict" />