java.lang.NoSuchMethodError: oauth.signpost.OAuthProvider.retrieveRequestToken

698 views
Skip to first unread message

Matthew Markus

unread,
Jun 11, 2012, 3:30:14 PM6/11/12
to Signpost users
I'm developing on Android (API Level 8) with javac 1.6.0_31, signpost-
core-1.2.1.2.jar, and signpost-commonshttp4-1.2.1.2.jar. For some
reason, my final APK fails on some phones due to a NoSuchMethodError
involving the retrieveRequestToken() method. This is very bizarre and
I wonder if it has something to do with the varargs in the method
signature or some kind of incompatibility between the two signpost jar
files. The strangest thing is that the dex processing seems to be
marking the retrieveRequestToken() method as deprecated at the
bytecode level as can be seen from the following decompilation of
AbstractOAuthProvider (using jd-gui):

/** @deprecated */
public String retrieveRequestToken(OAuthConsumer paramOAuthConsumer,
String paramString, String[] paramArrayOfString)
throws OAuthMessageSignerException, OAuthNotAuthorizedException,
OAuthExpectationFailedException, OAuthCommunicationException
{
monitorenter;
try
{
paramOAuthConsumer.setTokenWithSecret(null, null);
HttpParameters localHttpParameters = new HttpParameters();
...

I do not see this "/** @deprecated */" annotation when I build with
signpost-core-1.2.1.1.jar and signpost-commonshttp4-1.2.1.1.jar:

public String retrieveRequestToken(OAuthConsumer paramOAuthConsumer,
String paramString)
throws OAuthMessageSignerException, OAuthNotAuthorizedException,
OAuthExpectationFailedException, OAuthCommunicationException
{
paramOAuthConsumer.setTokenWithSecret(null, null);
String str1 = this.requestTokenEndpointUrl;
...

I am probably going to roll back to those files for now. Does anyone
have any additional insight into this problem?

Matthias

unread,
Jun 11, 2012, 3:44:00 PM6/11/12
to signpos...@googlegroups.com
This sounds pretty bizarre indeed. Are you using ProGuard to obfuscate your code?

Matthias

unread,
Jun 11, 2012, 3:49:47 PM6/11/12
to signpos...@googlegroups.com
another thing I can think of (may be somewhat far fetched, but still):

the library depends on Commons Codec, which was integrated into Android at some point. Since it wasn't in earlier versions, you will get ClassNotFound errors on some versions of Android but not on others. However, I have seen the dexer (and Android) output rather obscure error messages when a dependency was missing... double check if Apache Commons Codec is available on the devices you support or distribute it with your app.

Matthew Markus

unread,
Jun 11, 2012, 3:53:38 PM6/11/12
to Signpost users
Yes, we do use Proguard, and initially I thought that was the problem.
Even after the following, the error still appears:

-keep class oauth.signpost.** {
public protected *;
}

I suppose it could still be Proguard; however, the strange "/**
@deprecated */" annotations appear regardless of Proguard.

Matthew Markus

unread,
Jun 11, 2012, 3:55:29 PM6/11/12
to Signpost users
The app is currently distributed with commons-codec-1.6.jar.
Reply all
Reply to author
Forward
0 new messages