-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Describe the bug
I am attempting to test Capillary in a simple Android app (on device), but during the gradle build process I am getting "Error: Program type already present: com.google.protobuf.AnyProto" (or other classes).
I am using Google Firebase-Firestore DB, which implements grpc and uses nested dependency: com.google.protobuf:protobuf-lite:3.0.1.
Also, the google/Capillary library uses nested dependency: com.google.protobuf:protobuf-java:3.4.0.
If I exclude com.google.protobuf from the Capillary lib dependency only, the app will run, then crash when RSAKeyManager is instantiated, with error: "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/protobuf/GeneratedMessageV3;" (I will not be implementing any direct client -> capillary service grpc, as both will have access to Firestore DB, and the capillary service will not be exposed to ingress)
To Reproduce
I assume that adding google/Firestore dependencies to the demo/Android app will also cause this build error. It will sync/build in Android Studio, but build error occurs only when the app is run.
Expected behavior
Through some form of gradle dependency exclusions, will I be able to get these packages to run in the same Android app?
I have tried using several combinations of package exclusions, including fully excluding com.google.protobuf from both Firestore and Capillary and implementing either separately:
implementation('com.google.protobuf:protobuf-java:3.4.0')
//{OR}
//implementation('com.google.protobuf:protobuf-lite:3.0.1')
implementation('com.google.firebase:firebase-firestore:18.2.0', {
exclude group: 'com.google.protobuf', module: 'protobuf-lite'
})
implementation('com.google.capillary:lib-android:1.0.0', {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
})
