Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidTwitterLogin Exception #7

Open
jiteshp opened this issue Mar 17, 2013 · 4 comments
Open

AndroidTwitterLogin Exception #7

jiteshp opened this issue Mar 17, 2013 · 4 comments

Comments

@jiteshp
Copy link

jiteshp commented Mar 17, 2013

Calling run() on the AndroidTwitterLogin class results in an java.lang.NoSuchMethodError Exception.

AndroidTwitterLogin login = 
    new AndroidTwitterLogin(this, CONSUMER_KEY, CONSUMER_SECRET, null) {
        @Override
        protected void onSuccess(Twitter arg0, String[] arg1) {
            Toast.makeText(SearchResultsActivity.this, "Login successful", Toast.LENGTH_LONG).show();
    }
};
login.run();

results in

java.lang.NoSuchMethodError: android.util.Log.i
at winterwell.jtwitter.android.AndroidTwitterLogin.run(AndroidTwitterLogin.java:78)
@winterstein
Copy link
Owner

Hi Jiteshp,

I'm busy at the moment, but I'll try to look into this soon.

Could you send me an example Eclipse project which causes this?
Please include all the files, except for the bin and gen directories
-- i.e. do include hidden files such as .project and .classpath.

Someone else reported a similar problem. At first glance: it looks
like a project-setup issue to me. I need to reproduce it to dig
deeper.

Best regards,

  • Daniel


Dr Daniel Winterstein
Director
Edinburgh +44 (0)772 5172 612
http://winterwell.com http://soda.sh

@BryceCicada
Copy link

I also see this problem as described above verbatim after importing the jtwitter and signpost jars into my Android libs directory. I'm using android SDK and Eclipse ADT at v22.0.1.

I've exported 'Android Private Libraries' from my build-path.

@winterstein
Copy link
Owner

Hello,

I've done a fresh build of JTwitter (v2.8.7) against the latest android.jar.

http://www.winterwell.com/software/jtwitter/jtwitter.jar
Or on GitHub:
https://github.com/winterstein/JTwitter

Could you give that a try, and let me know if it fixes the problem?
Thanks,

  • Daniel

@BryceCicada
Copy link

Thanks for the fix so quickly. That works for me.

However, now AndroidTwitterLogin code fails just a few lines later with:

06-05 15:03:13.766 I/dalvikvm(20132): Could not find method oauth.signpost.basic.DefaultOAuthProvider.retrieveRequestToken, referenced from method winterwell.jtwitter.OAuthSignpostClient.authorizeUrl
06-05 15:03:13.766 W/dalvikvm(20132): VFY: unable to resolve virtual method 26159: Loauth/signpost/basic/DefaultOAuthProvider;.retrieveRequestToken (Loauth/signpost/OAuthConsumer;Ljava/lang/String;)Ljava/lang/String;
06-05 15:03:13.766 D/dalvikvm(20132): VFY: replacing opcode 0x6e at 0x0006
06-05 15:03:13.776 D/dalvikvm(20132): VFY: dead code 0x0009-000f in Lwinterwell/jtwitter/OAuthSignpostClient;.authorizeUrl ()Ljava/net/URI;
06-05 15:03:13.776 I/dalvikvm(20132): Could not find method oauth.signpost.basic.DefaultOAuthProvider.retrieveAccessToken, referenced from method winterwell.jtwitter.OAuthSignpostClient.setAuthorizationCode
06-05 15:03:13.776 W/dalvikvm(20132): VFY: unable to resolve virtual method 26158: Loauth/signpost/basic/DefaultOAuthProvider;.retrieveAccessToken (Loauth/signpost/OAuthConsumer;Ljava/lang/String;)V
06-05 15:03:13.776 D/dalvikvm(20132): VFY: replacing opcode 0x6e at 0x000e
06-05 15:03:13.786 D/dalvikvm(20132): VFY: dead code 0x0011-0021 in Lwinterwell/jtwitter/OAuthSignpostClient;.setAuthorizationCode (Ljava/lang/String;)V
06-05 15:03:13.786 I/jtwitter(20132): TwitterAuth run!
06-05 15:03:14.187 D/AndroidRuntime(20132): Shutting down VM
06-05 15:03:14.187 W/dalvikvm(20132): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-05 15:03:14.187 W/System.err(20132): java.lang.NoSuchMethodError: oauth.signpost.basic.DefaultOAuthProvider.retrieveRequestToken
06-05 15:03:14.187 W/System.err(20132):     at winterwell.jtwitter.OAuthSignpostClient.authorizeUrl(OAuthSignpostClient.java:307)
06-05 15:03:14.187 W/System.err(20132):     at winterwell.jtwitter.android.AndroidTwitterLogin$3.run(AndroidTwitterLogin.java:137)
06-05 15:03:14.187 W/System.err(20132):     at android.os.Handler.handleCallback(Handler.java:587)
06-05 15:03:14.187 W/System.err(20132):     at android.os.Handler.dispatchMessage(Handler.java:92)
06-05 15:03:14.187 W/System.err(20132):     at android.os.Looper.loop(Looper.java:123)
06-05 15:03:14.187 W/System.err(20132):     at android.app.ActivityThread.main(ActivityThread.java:3683)
06-05 15:03:14.197 W/System.err(20132):     at java.lang.reflect.Method.invokeNative(Native Method)
06-05 15:03:14.197 W/System.err(20132):     at java.lang.reflect.Method.invoke(Method.java:507)
06-05 15:03:14.197 W/System.err(20132):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-05 15:03:14.197 W/System.err(20132):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-05 15:03:14.197 W/System.err(20132):     at dalvik.system.NativeStart.main(Native Method)
06-05 15:03:14.237 E/We7Application(20132): Uncaught Exception: Thread[main,5,main],main,oauth.signpost.basic.DefaultOAuthProvider.retrieveRequestToken

On further investigation, I get this error with just the following code too:

OAuthSignpostClient client = new OAuthSignpostClient(TWITTER_APP_KEY, TWITTER_APP_CLIENT_SECRET, "oob");
URI url = client.authorizeUrl();

I have the signpost jars in my android libs directory from the JTwitter zipfile. The md5sum of these jars match the 1.2.1.2 jars available from http://code.google.com/p/oauth-signpost. "Android Private Libraries" is exported.

It appears that if I replace the 1.2.1.2 signpost jars with version 1.2.1.1 jars from http://code.google.com/p/oauth-signpost, then this error does not occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants