sprinklr-inc/twitter4j-ads

version 1.1 does not work for creating TwitterAdsFactory

Closed this issue · 3 comments

I use 1.0 version of twitter4j-ads to create TwitterAdsFactory and it works just fine. I tried to upgrade to newly released version 1.1 and the following fails since it can not create an instance of class TwitterAdsFactory.
TwitterAdsFactory tf = new TwitterAdsFactory(configuration.build());

I suspect (and I might be wrong) it might be due to:
String className = "twitter4j.internal.models4j.TwitterImpl";

I also had to change the packahe for TwitterException to twitter4j.internal.models4j.TwitterException which is not backward compatible for createAsyncJob call among most other calls.

Essentially it does not play well with twitter4j library for TwitterExcelption, Configuration, TwitterImpl etc.. So, based on which library is picked up first, the code does or does not run. In my project, I need both libraries (since I am also using twitter4j for accessing twitter). I think the package names need to be different to distinguish between these 2 libraries since twitter4j-ads depends on twitter4j internally.

A simple program with following 2 lines will fail no matter the order of whether twitter4j is first or twitter4j-ads is first:

TwitterAdsFactory tfa = new TwitterAdsFactory(new ConfigurationBuilder().build());
TwitterFactory tf = new TwitterFactory();

Thanks for flagging this @shrikantjoshi, we will resolve and push this asap

Any updates on this?

Please check the recent update for 2.1