Twitter4j - import issue - AndroidStudio

832 views Asked by At

I've migrated an Eclipse example to Androidstudio gradle type project.

I've added twitter4j libraries to module build.gradle:

dependencies {
    compile 'org.twitter4j:twitter4j:4.0.3'
    compile 'org.twitter4j:twitter4j-core:4.0.3'
    compile 'com.twitter:hbc-twitter4j-v3:1.4.2'
    compile 'org.twitter4j:twitter4j-http2-support:4.0.3'
}

It's importing twitter4j classes, but not these ones:

import twitter4j.http.AccessToken;
import twitter4j.http.RequestToken;

It says cannot resolve symbol http

I've tried importing the twitter4j.http but nothing I just can't make it work.

I'm using:

dependencies {
    classpath 'com.android.tools.build:gradle:1.2.3'
}

Anybody can shed some light on this?

I've looked for hours but no solution yet :(

Thanks in advance!

1

There are 1 answers

3
Code-Apprentice On BEST ANSWER

AccessToken is in the twitter4j.auth package. I assume there is a similar problem with your other classes. It appears that the package structure has been rearranged from earlier versions. I suggest you bookmark the twitter4j JavaDocs and refer to them regularly.