mediapipe
mediapipe copied to clipboard
MediaPipe crashes in release mode with filePointerMeta_ not found
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
Yes
OS Platform and Distribution
Android 12 (API 31)
Mobile device if the issue happens on mobile device
Samsung Galaxy S10e
Browser and version if the issue happens on browser
No response
Programming Language and version
Dart, Kotlin
MediaPipe version
com.google.mediapipe:tasks-vision:latest.release
Bazel version
No response
Solution
Object Detection
Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
No response
Xcode & Tulsi version (if issue is related to building for iOS)
No response
Describe the actual behavior
App works in debug mode but crashes in release mode
Describe the expected behaviour
Should work in both modes
Standalone code/steps you may have used to try to get what you need
App works in release mode also if I have have this proguard-rules.pro:
-dontobfuscate
-keep class com.google.mediapipe.** {*;}
But without them, the app crashes on the first Media Pipe API call (ImageClassifier.createFromOptions) with a message saying Field filePointerMeta_ not found.
Other info / Complete Logs
E/AndroidRuntime(32704): FATAL EXCEPTION: main
E/AndroidRuntime(32704): Process: se.ndssoft.mycamx_example, PID: 32704
E/AndroidRuntime(32704): java.lang.RuntimeException: Field filePointerMeta_ for com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile not found. Known fields are [private int com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.bitField0_, private com.google.protobuf.ByteString com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.fileContent_, private com.google.mediapipe.tasks.core.proto.ExternalFileProto$FileDescriptorMeta com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.fileDescriptorMeta_, private java.lang.String com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.fileName_, private static final com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.DEFAULT_INSTANCE, private static volatile com.google.protobuf.Parser com.google.mediapipe.tasks.core.proto.ExternalFileProto$ExternalFile.PARSER]
E/AndroidRuntime(32704): at com.google.protobuf.MessageSchema.reflectField(MessageSchema.java:614)
E/AndroidRuntime(32704): at com.google.protobuf.MessageSchema.newSchemaForRawMessageInfo(MessageSchema.java:507)
E/AndroidRuntime(32704): at com.google.protobuf.MessageSchema.newSchema(MessageSchema.java:227)
E/AndroidRuntime(32704): at com.google.protobuf.ManifestSchemaFactory.newSchema(ManifestSchemaFactory.java:77)
E/AndroidRuntime(32704): at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:71)
E/AndroidRuntime(32704): at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:90)
E/AndroidRuntime(32704): at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:104)
E/AndroidRuntime(32704): at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175)
E/AndroidRuntime(32704): at com.google.protobuf.GeneratedMessageLite$Builder.buildPartial(GeneratedMessageLite.java:397)
E/AndroidRuntime(32704): at com.google.protobuf.GeneratedMessageLite$Builder.build(GeneratedMessageLite.java:405)
E/AndroidRuntime(32704): at com.google.mediapipe.tasks.core.TaskOptions.convertBaseOptionsToProto(TaskOptions.java:96)
E/AndroidRuntime(32704): at com.google.mediapipe.tasks.vision.imageclassifier.ImageClassifier$ImageClassifierOptions.convertToCalculatorOptionsProto(ImageClassifier.java:492)
E/AndroidRuntime(32704): at com.google.mediapipe.tasks.core.TaskInfo.generateGraphConfig(TaskInfo.java:115)
E/AndroidRuntime(32704): at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:62)
E/AndroidRuntime(32704): at com.google.mediapipe.tasks.vision.imageclassifier.ImageClassifier.createFromOptions(ImageClassifier.java:197)
E/AndroidRuntime(32704): at se.ndssoft.mycamx.MycamxPlugin.startCamera$lambda-5(MycamxPlugin.kt:184)
E/AndroidRuntime(32704): at se.ndssoft.mycamx.MycamxPlugin.$r8$lambda$19IJth9POmELAd1Y_i7or_Fb6W8(MycamxPlugin.kt:0)
E/AndroidRuntime(32704): at se.ndssoft.mycamx.MycamxPlugin$$ExternalSyntheticLambda0.run(R8$$SyntheticClass:0)
E/AndroidRuntime(32704): at android.os.Handler.handleCallback(Handler.java:938)
E/AndroidRuntime(32704): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(32704): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(32704): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(32704): at android.app.ActivityThread.main(ActivityThread.java:8751)
E/AndroidRuntime(32704): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32704): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(32704): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Hi @BoHellgren,
Certainly, could you confirm whether this is connected to issue #5134? If so, please provide details on the recent problem in the same thread #5134, as we are already addressing it, and proceed to close this issue.
Thank you!!!
No, they are not related at all. This one was tested on a real device. 5134 is about problems running on an emulator.
Hi @BoHellgren,
We have released a new version (0.10.10) to the Maven repository here. Could you please update to the latest version and retest on your Samsung physical device to see if the crash persists? Please report back the results.
Thank you!!
I updated to implementation 'com.google.mediapipe:tasks-vision:0.10.10' but it made no difference. Still exactly the same crash unless I have -keep class com.google.mediapipe.** {*;} in proguardrules.pro Tested on a Samsung Galaxy S10e. Since I have this bypass, I can live with this bug, I just reported it to help you. But please make your sample apps work on emulators!
Hi @BoHellgren,
Based on recent reported issues suggest that the problem has been fixed in version 0.10.10 and later versions. Could you please try running it with these versions and let us know if the crash still happens?
Thank you!!
I tested with version 0.10.11. Made no difference. You are probably missing a @pragma('vm:entry-point')
Hi @BoHellgren,
Is this issue #5201 and #5201(comment) helpful for addressing the problem you are encountering? Additionally, please inform us if both issues are similar.
Thank you!!
5201 is similar. It should not be necessary to have proguard rules to make mediapipe work in release mode. It is not clear if the comment means he has it working with or without proguard rules.