title: googlecredential no such method error
body: <p>I am trying to construct a google credential object so that I can use google plus Oauth, but keep getting an error. My client-id and client-secret are exactly as given in my developer console, so I don't think it's that. </p>
  
  <p>My code is: </p>
  
  <pre><code>GoogleCredential credential = new GoogleCredential.Builder()
          .setJsonFactory(JSON_FACTORY).setTransport(TRANSPORT)
          .setClientSecrets(CLIENT_ID, CLIENT_SECRET).build();
  </code></pre>
  
  <p>Here is the error I'm getting:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [ConnectServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
  java.lang.NoSuchMethodError: com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder.getRefreshListeners()Ljava/util/List;
      at com.google.api.client.googleapis.auth.oauth2.GoogleCredential$Builder.build(GoogleCredential.java:394)
      at com.google.gplus.ConnectServlet.doPost(ConnectServlet.java:128)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
      at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>And here are the relevant jars I'm using:</p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
              &lt;artifactId&gt;google-api-services-plus&lt;/artifactId&gt;
              &lt;version&gt;v1-rev64-1.13.2-beta&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
              &lt;artifactId&gt;lombok&lt;/artifactId&gt;
              &lt;version&gt;1.14.8&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.http-client&lt;/groupId&gt;
              &lt;artifactId&gt;google-http-client-jackson&lt;/artifactId&gt;
              &lt;version&gt;1.19.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.oauth-client&lt;/groupId&gt;
              &lt;artifactId&gt;google-oauth-client&lt;/artifactId&gt;
              &lt;version&gt;1.19.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
              &lt;artifactId&gt;google-api-services-oauth2&lt;/artifactId&gt;
              &lt;version&gt;v2-rev50-1.17.0-rc&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>Any input would be much appreciated. I googled it and didn't see anything similar.</p>