title: NoSuchMethodError for com.google.protobuf.AbstractMessage.newBuilderForType on Spanner Java Client
body: <p>Get this error while trying to experiment on google's cloud spanner by running the sample code </p>
  
  <p><a href="https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java" rel="nofollow noreferrer">https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/spanner/cloud-client/src/main/java/com/example/spanner/SpannerSample.java</a></p>
  
  <p>The stacktrace is as follows:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoSuchMethodError: com.google.protobuf.AbstractMessage.newBuilderForType(Lcom/google/protobuf/AbstractMessage$BuilderParent;)Lcom/google/protobuf/Message$Builder;
  at com.google.protobuf.SingleFieldBuilderV3.getBuilder(SingleFieldBuilderV3.java:142)
  at com.google.spanner.v1.Mutation$Builder.getInsertBuilder(Mutation.java:3227)
  at com.google.cloud.spanner.Mutation.toProto(Mutation.java:377)
  at com.google.cloud.spanner.SpannerImpl$TransactionContextImpl.commit(SpannerImpl.java:1223)
  at com.google.cloud.spanner.SpannerImpl$TransactionRunnerImpl.run(SpannerImpl.java:1148)
  at com.google.cloud.spanner.SpannerImpl$SessionImpl.write(SpannerImpl.java:704)
  at com.google.cloud.spanner.SessionPool$PooledSession.write(SessionPool.java:201)
  at com.google.cloud.spanner.DatabaseClientImpl.write(DatabaseClientImpl.java:31)
  at spanner_test.SpannerSample.writeExampleData(SpannerSample.java:164)
  at spanner_test.SpannerSample.run(SpannerSample.java:423)
  at spanner_test.SpannerSample.main(SpannerSample.java:501)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
  </code></pre>
  
  <p>I am using gradle and my dependency is as follows:</p>
  
  <p>spanner: </p>
  
  <pre><code>com.google.cloud:google-cloud-spanner:0.9.4-beta'
  </code></pre>
  
  <p>protobuf:</p>
  
  <pre><code>com.google.protobuf:protobuf-java:3.1.0
  </code></pre>