Skip to content

SDK fat-jar bundles org.meshtastic.proto.* classes — causes R8 duplicate class errors #5

Description

@jamesarich

Problem

takpacket-sdk-jvm-v0.1.3.jar is a fat-jar that bundles 114 org/meshtastic/proto/* class files alongside the 33 org/meshtastic/tak/* SDK classes. These proto classes are the same Wire-generated types from the shared meshtastic/protobufs repo.

Any consumer that also depends on the proto module (e.g., core/proto in Meshtastic-Android) hits R8 duplicate class errors during release builds:

ERROR: R8: Type org.meshtastic.proto.AircraftTrack$Companion$ADAPTER$1 is defined multiple times:
  core/proto/build/.../classes.jar
  takpacket-sdk-jvm-v0.1.3.jar

Expected behavior

The SDK should declare the proto types as a transitive dependency (via api(...) or implementation(...)) rather than bundling them in the JAR. This lets Gradle deduplicate them at dependency resolution time.

Workaround

Consumers can use a Gradle artifact transform to strip org/meshtastic/proto/** from the SDK JAR before R8, but this is fragile and should not be necessary.

Reproduction

# In Meshtastic-Android on the tak_v2 branch:
./gradlew :app:assembleFdroidRelease
# Fails with "Type org.meshtastic.proto.AircraftTrack... is defined multiple times"

Affected version

com.github.meshtastic.TAKPacket-SDK:takpacket-sdk-jvm:v0.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions