Skip to content

Android HolisticLandmarker 1.0.0 crashes: Any$Builder.build() NoSuchMethodError with protobuf-javalite #6348

Open

Description

@lautipaletta

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

Android 15 (physical device, MIUI-based), also reproduced on a clean AGP/Gradle setup with no other change to the official examples/holistic_landmarker/android sample's dependency setup besides the version bump described below.

Mobile device if the issue happens on mobile device

Physical Android device (arm64-v8a)

Browser and version if the issue happens on browser

No response

Programming Language and version

Kotlin / Java (Android), Kotlin 2.4.0

MediaPipe version

1.0.0

Bazel version

N/A (Gradle build, not Bazel) — Gradle 9.3.1, AGP 8.11.1

Solution

Holistic (HolisticLandmarker)

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

compileSdk 35, minSdk 24, targetSdk 35. Standard Flutter/Gradle Android build (no NDK involved on the Java/Kotlin side).

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

Calling HolisticLandmarker.createFromOptions(context, options) (LIVE_STREAM mode, options built exactly as in the official HolisticLandmarkerHelper.kt sample) throws:

java.lang.NoSuchMethodError: No virtual method build()Lcom/google/protobuf/Any; in class Lcom/google/protobuf/Any$Builder; or its super classes (declaration of 'com.google.protobuf.Any$Builder' appears in <app>.apk)
    at com.google.mediapipe.tasks.vision.holisticlandmarker.HolisticLandmarker$HolisticLandmarkerOptions.convertToAnyProto(HolisticLandmarker.java:620)
    at com.google.mediapipe.tasks.core.TaskInfo.generateGraphConfig(TaskInfo.java:125)
    at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:82)
    at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:58)
    at com.google.mediapipe.tasks.vision.holisticlandmarker.HolisticLandmarker.createFromOptions(HolisticLandmarker.java:250)

tasks-core:1.0.0's own POM declares a compile dependency on com.google.protobuf:protobuf-javalite:4.26.1. With that (declared) version present, HolisticLandmarker.createFromOptions always throws the above. I tested the entire available protobuf-javalite version range to rule out a simple version-pinning issue (as in the historical #2456, which was the opposite direction and was fixed by MediaPipe switching solution-core from full to lite protobuf):

protobuf-javalite version Result
3.25.5 NoSuchMethodError (same as above)
4.26.1 (declared by tasks-core's own POM) NoSuchMethodError (same as above)
4.28.0 NoSuchMethodError (same as above)
4.36.0 (latest as of writing) NoSuchMethodError (same as above)

None of these provide a com.google.protobuf.Any$Builder.build() method with the signature MediaPipe's compiled bytecode expects. This looks like HolisticLandmarkerOptions.convertToAnyProto (and likely other tasks-core code building Any protos) was actually compiled/linked against full protobuf-java, not protobuf-javalite, and the POM's declared protobuf-javalite dependency is simply the wrong artifact for this release.

The only configuration that actually works is excluding protobuf-javalite entirely and depending on full protobuf-java instead (exactly what examples/holistic_landmarker/android/app/build.gradle in this repo already does — I initially assumed that was legacy/defensive boilerplate, but it turns out to be load-bearing and required, not optional, and is currently undocumented there).

Describe the expected behaviour

HolisticLandmarker.createFromOptions should succeed using the dependency set declared by tasks-core's own POM (i.e. implementation("com.google.mediapipe:tasks-vision:1.0.0") alone, with no manual exclude/protobuf-java swap), OR the POM should declare protobuf-java (full) as the actual required dependency so Gradle resolves correctly without a manual workaround.

This matters beyond convenience: requiring full protobuf-java makes tasks-vision:1.0.0 incompatible with any app that also depends on Firebase Firestore (com.google.firebase:firebase-firestore, via protolite-well-known-types + grpc-protobuf-lite), since Firestore requires protobuf-javalite and full/lite protobuf cannot coexist on one classpath (confirmed: forcing full protobuf-java app-wide fails at mergeDebugJavaResource with duplicate google/protobuf/descriptor.proto between protobuf-java and protolite-well-known-types). This is the same underlying class of conflict tracked in firebase/firebase-android-sdk#5997, #6359 and protocolbuffers/protobuf#18127, just triggered from the MediaPipe side this time.

Standalone code/steps you may have used to try to get what you need

  1. app/build.gradle:
    dependencies {
        implementation 'com.google.mediapipe:tasks-vision:1.0.0'
    }
  2. Minimal repro, following HolisticLandmarkerHelper.kt from examples/holistic_landmarker/android verbatim:
    val baseOptions = BaseOptions.builder()
        .setModelAssetPath("holistic_landmarker.task")
        .build()
    val options = HolisticLandmarker.HolisticLandmarkerOptions.builder()
        .setBaseOptions(baseOptions)
        .setRunningMode(RunningMode.LIVE_STREAM)
        .setResultListener { result, _ -> /* ... */ }
        .setErrorListener { /* ... */ }
        .build()
    val landmarker = HolisticLandmarker.createFromOptions(context, options) // <-- throws here
  3. Crash reproduces immediately, every time, on every protobuf-javalite version listed above.
  4. Swapping to implementation('com.google.mediapipe:tasks-vision:1.0.0') { exclude group: 'com.google.protobuf', module: 'protobuf-javalite' } + implementation 'com.google.protobuf:protobuf-java:3.25.5' (i.e. exactly what examples/holistic_landmarker/android/app/build.gradle in this repo does) fixes it — confirmed working live on-device (pose + face + hand landmarks render correctly).

Other info / Complete Logs

Full stack trace:

E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: java.lang.NoSuchMethodError: No virtual method build()Lcom/google/protobuf/Any; in class Lcom/google/protobuf/Any$Builder; or its super classes (declaration of 'com.google.protobuf.Any$Builder' appears in base.apk)
E AndroidRuntime: 	at com.google.mediapipe.tasks.vision.holisticlandmarker.HolisticLandmarker$HolisticLandmarkerOptions.convertToAnyProto(HolisticLandmarker.java:620)
E AndroidRuntime: 	at com.google.mediapipe.tasks.core.TaskInfo.generateGraphConfig(TaskInfo.java:125)
E AndroidRuntime: 	at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:82)
E AndroidRuntime: 	at com.google.mediapipe.tasks.core.TaskRunner.create(TaskRunner.java:58)
E AndroidRuntime: 	at com.google.mediapipe.tasks.vision.holisticlandmarker.HolisticLandmarker.createFromOptions(HolisticLandmarker.java:250)

Related issues that describe the same underlying full-vs-lite protobuf conflict class, for context:

Also worth noting: examples/holistic_landmarker/android/app/build.gradle in this repo already has the exclude+protobuf-java workaround, but with no comment explaining why it's required — worth documenting there so future readers don't assume it's removable boilerplate.

Happy to provide a minimal standalone Gradle project reproducing this if useful.

Activity

  1. HarishPermal commented on Aug 24, 2026

    @HarishPermal

    hi @lautipaletta

    Thanks for the detailed, report i'll try it from my end and get back with updates.

  2. lautipaletta commented on Sep 4, 2026

    @lautipaletta
    Author

    Hi @HarishPermal, could you review this issue?

  3. HarishPermal commented on Sep 4, 2026

    @HarishPermal

    Hi @lautipaletta

    Im working on it, once the changes are commited i'll update here

    Thanks Again

  4. HarishPermal commented on Sep 4, 2026

    @HarishPermal

    hi @lautipaletta,

    can you test with the latest master branch and let me know

  5. lautipaletta commented on Sep 10, 2026

    @lautipaletta
    Author

    hi @HarishPermal, what do you mean to test with the latest master branch?

    Should I compile locally the package and try? I don't think I have enough expertise to do that.

  6. HarishPermal commented on Sep 14, 2026

    @HarishPermal

    Sorry @lautipaletta

    My bad, i've made the changes in the source code, now i'll discuss with the team to publish a new Maven artifacts.

  7. lautipaletta commented on Sep 14, 2026

    @lautipaletta
    Author

    I would appreciate that so much, thank you @HarishPermal!

  8. lautipaletta commented on Sep 17, 2026

    @lautipaletta
    Author

    Hi @HarishPermal, do you have any good news?

  9. HarishPermal commented on Sep 22, 2026

    @HarishPermal

    hi @lautipaletta

    I've discussed with the team, very soon we will publish the new maven artifact

  10. lautipaletta commented on Sep 22, 2026

    @lautipaletta
    Author

    Hi @HarishPermal, thanks, I'll be waiting for it.

  11. lautipaletta commented on Oct 5, 2026

    @lautipaletta
    Author

    Hi @HarishPermal , do you have updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform:androidIssues with Android as Platformtype:bugBug in the Source Code of MediaPipe Solution

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions