You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please provide consumer proguard rules for R8/Proguard on Android #6392
Describe the feature and the current behaviour/state
Currently, everyone using mediapipe on android is copy pasting some terribly inefficient -keep rules to support R8. Mediapipe should use Android's keep annotations and/or fine-grained minimal keep rules (including using proper aar deps for things like flogger, and protobuf to their own consumer proguared rules are pulled via maven).
Will this change the current API? How?
No
Who will benefit with this feature?
All android users of mediapipe.
Please specify the use cases for this feature
Android apps
Any Other info
"Describe the feature and the current behaviour/state" in this template should be turned into a multiline text field instead of one line. Same for this text box and most of the others.
+1 To this issue. We are using Proguard/Dexguard as well and its difficult to know if the rules need to change/update as new versions of MediaPipe are released. Our rules currently look something like the snippet below and the ** rules are not ideal.
# MediaPipe references generated proto classes that its published AAR does not contain.
-dontwarn com.google.mediapipe.proto.CalculatorProfileProto$CalculatorProfile
-dontwarn com.google.mediapipe.proto.GraphTemplateProto$CalculatorGraphTemplate
# MediaPipe 1.1.0 declares LiteRT-LM as an optional Maven dependency. Only ImageEmbedder's LiteRT-LM
# executor references it, and ImageEmbedder probes for it with Class.forName before using it.
-dontwarn com.google.ai.edge.litertlm.**
# MediaPipe (as of 1.1.0) does not publish consumer rules even though its Java/JNI boundary resolves
# framework and task classes by name. Keep that dependency boundary intact in optimized builds.
-keep class com.google.mediapipe.** { *; }
# Flogger discovers logger and call-site identity from live stack frames. Renaming, inlining, or
# removing those frames breaks MediaPipe's Graph class initialization in optimized builds.
-keep class com.google.common.flogger.** { *; }
# The protobuf full runtime loads DescriptorMessageInfoFactory by its original name and uses it to
# reflect over messages such as Any while MediaPipe serializes calculator graph configuration.
-keep class com.google.protobuf.** { *; }
Activity
akashvverma1995 commentedon Nov 2, 2026
Hi @AlexanderGH
Thank you for raising this feature request. I'll look into it and get back to you with an updates.
ryank311 commentedon Nov 2, 2026
+1 To this issue. We are using Proguard/Dexguard as well and its difficult to know if the rules need to change/update as new versions of MediaPipe are released. Our rules currently look something like the snippet below and the
**rules are not ideal.