Skip to content

Shrink, Obfuscate, and Optimize your app

Android

For obfuscation and resources optimization, use

minifyEnabled true
shrinkResources true

Make sure to add the following exclusion rules to app/proguard-rules.pro:

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

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

<resources xmlns:tools="http://schemas.android.com/tools"
    tools:keep="@raw/ml_face_isface,
    @raw/ml_face_mnet,
    @raw/ml_face_landmark,
    @raw/ml_face_contour"
    tools:shrinkMode="strict" />