After adding Square's Wire library for Protobuf support in an Android project, I'm getting the following D8 exception during compilation:
D8: Program type already present: com.google.protobuf.DescriptorProto$ExtensionRange$ProtoAdapter_ExtensionRange
wire dependency: implementation 'com.squareup.wire:wire-runtime:2.2.0'
Gradle's dependencyInsight
revealed one other dependency in my project that was transitively bringing in com.google.protobuf.nano:protobuf-javanano:3.1.0
. So I added an exclude with:
implementation ('com.google.vr:sdk-base:1.100.0'){
exclude group: 'com.google.protobuf.nano'
}
but that didn't fix the problem.
What's making D8 sad, and how can I make it happy again?
Update
The problematic setup is: have 3 modules A
, B
, C
. A
depends on B
and C
. B
and C
are both hosted on an internal maven server, they each depend on wire-runtime
with the following POM entry:
<dependency>
<groupId>com.squareup.wire</groupId>
<artifactId>wire-runtime</artifactId>
<version>2.3.0-RC1</version>
<scope>compile</scope>
</dependency>
I've tried Wire version 2.2 and 2.3.0. Everything is peachy when A
depends on only B
or only C
, but D8 gets sad when A
depends on both B
and C
.
So how do you depend on mutliple modules that transitively depend on Wire?