Skip to content

Commit e5a7b0f

Browse files
justinuangigorbernstein2
authored andcommitted
Add section about gRPC version conflicts to README (#53)
* Add section about gRPC version conflicts to README * Fix
1 parent f355230 commit e5a7b0f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ try {
162162
}
163163
```
164164

165+
TIP: If you are experiencing version conflicts with gRPC, see [Version Conflicts](#version-conflicts).
166+
165167
## OpenCensus Tracing
166168

167169
Cloud Bigtable client supports [OpenCensus Tracing](https://opencensus.io/tracing/),
@@ -318,6 +320,33 @@ StackdriverStatsExporter.createAndRegister(
318320
BigtableDataSettings.enableOpenCensusStats();
319321
```
320322

323+
## Version Conflicts
324+
325+
google-cloud-bigtable depends on gRPC directly which may conflict with the versions brought
326+
in by other libraries, for example Apache Beam. This happens because internal dependencies
327+
between gRPC libraries are pinned to an exact version of grpc-core
328+
(see [here](https://github.com/grpc/grpc-java/commit/90db93b990305aa5a8428cf391b55498c7993b6e)).
329+
If both google-cloud-bigtable and the other library bring in two gRPC libraries that depend
330+
on the different versions of grpc-core, then dependency resolution will fail.
331+
The easiest way to fix this is to depend on the gRPC bom, which will force all the gRPC
332+
transitive libraries to use the same version.
333+
334+
Add the following to your project's pom.xml.
335+
336+
```
337+
<dependencyManagement>
338+
<dependencies>
339+
<dependency>
340+
<groupId>io.grpc</groupId>
341+
<artifactId>grpc-bom</artifactId>
342+
<version>1.24.1</version>
343+
<type>pom</type>
344+
<scope>import</scope>
345+
</dependency>
346+
</dependencies>
347+
</dependencyManagement>
348+
```
349+
321350
## Troubleshooting
322351

323352
To get help, follow the instructions in the [shared Troubleshooting

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
<google.api-common.version>1.8.1</google.api-common.version>
159159
<google.common-protos.version>1.17.0</google.common-protos.version>
160160
<google.core.version>1.91.3</google.core.version>
161+
<!-- make sure to update the grpc version in README -->
161162
<grpc.version>1.24.1</grpc.version>
162163
<guava.version>28.1-android</guava.version>
163164
<opencensus.version>0.24.0</opencensus.version>

0 commit comments

Comments
 (0)