google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
26.98k stars 5.1k forks source link

ProguardFiles for Android #5514

Closed mmaciola closed 2 months ago

mmaciola commented 3 months ago

Android MediaPipe samples do not include a proguard file for minifyEnabled. Please provide proguard files so we can use MediaPipe in release projects.

For search engine; typical problem when the appropriate proguard file is missing:

java.lang.RuntimeException: Field platform_ for k5.h0 not found. Known fields are [public static final k5.h0 k5.h0.O, public static volatile s5.a0 k5.h0.P]
at s5.f1.E(Unknown Source:62)
at s5.f1.x(Unknown Source:669)
at s5.f1.w(Unknown Source:12)
at s5.l1.a(Unknown Source:130)
at s5.z.g(Unknown Source:25)
at s5.z.f(Unknown Source:0)
at com.google.mediapipe.tasks.core.a.i(Unknown Source:160)
at q5.e.b(Unknown Source:93)
kuaashish commented 3 months ago

Hi @mmaciola,

Yes, we are aware of this issue and are working towards a fix. In the meantime, if there is a known workaround, you can add these three rules below, which should work. Also, please check this issue https://github.com/google-ai-edge/mediapipe/issues/5486

-keep class com.google.mediapipe.proto.** { *; }
-keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite { *; }
-keep class com.google.common.flogger.** { *; }

Thank you!!

github-actions[bot] commented 2 months ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 2 months ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 2 months ago

Are you satisfied with the resolution of your issue? Yes No