bearyg / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

NoSuchMethodError exception for com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl.setScopes(Ljava/util/Collection;) #779

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.15.0-rc)?
1.15.0-rc

Java environment (e.g. Java 6, Android 2.3, App Engine)?
Java 6 and Java 7

Describe the problem.
java.lang.NoSuchMethodError: 
com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl.setScopes(Ljava/ut
il/Collection;)Lcom/google/api/client/auth/oauth2/AuthorizationCodeRequestUrl;

The problematic line of code:
AuthorizationCodeRequestUrl authorizationCodeURL=new 
AuthorizationCodeRequestUrl(URL, ID);
authorizationCodeURL.setScopes(scopes); //Scopes is an array list of strings

Thing is, this worked in a previous version of api using 
GoogleAuthorizationCodeRequestUrl class, which is deprecated now.

How would you expect it to be fixed?
Not sure, the method in question (setScopes) is there, the correct parameters 
for it are there.

Original issue reported on code.google.com by DarkR4z...@gmail.com on 14 May 2013 at 2:17

GoogleCodeExporter commented 9 years ago
This doesn't appear to be a bug with the library, as we are unable to reproduce 
the error. The method exists in the jars being distributed, and you can see it 
in the javadoc here: 
http://javadoc.google-oauth-java-client.googlecode.com/hg/1.15.0-rc/com/google/a
pi/client/auth/oauth2/AuthorizationCodeRequestUrl.html#method_detail

For more personalized support, please feel free to post on 
www.stackoverflow.com using the [google-api-java-client] tag.  As a suggestion, 
try re-downloading the jars from 
https://code.google.com/p/google-api-java-client/ (the one in question is the 
google-oauth-client jar).

Original comment by ngmic...@google.com on 14 May 2013 at 3:10

GoogleCodeExporter commented 9 years ago
Getting exactly the same error with the latest 1.15 version

Original comment by andriu...@gmail.com on 1 Jul 2013 at 12:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Still this issue persist.
Even I am getting it.
Exception in thread "main" java.lang.NoSuchMethodError: 
com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl.setScopes(Ljava/ut
il/Collection;)Lcom/google/api/client/auth/oauth2/AuthorizationCodeRequestUrl;
    at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl.setScopes(GoogleAuthorizationCodeRequestUrl.java:179)
    at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl.<init>(GoogleAuthorizationCodeRequestUrl.java:102)
    at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl.<init>(GoogleAuthorizationCodeRequestUrl.java:86)
    at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeRequestUrl.<init>(GoogleAuthorizationCodeRequestUrl.java:117)

Original comment by vandanad...@gmail.com on 1 Jul 2014 at 11:52