I'm using the TweetTimelineListAdapter
from Fabric
to display a list of tweets. This works fine with proguard disabled, but when I enable it, my UserTimeline
object stops returning any success or failure in its callback.
There are no errors or exceptions in my log. Stepping through the code reveals that the guest login is successful and the tweets request is sent but no response is ever received.
Here's how I'm fetching the tweets:
private void loadTweets() {
TwitterCore.getInstance().logInGuest(new Callback<AppSession>() {
@Override
public void success(Result<AppSession> result) {
// logging in is successful, this code executes
UserTimeline userTimeline = new UserTimeline.Builder()
.screenName("@ScreenName")
.maxItemsPerRequest(100)
.includeReplies(false)
.includeRetweets(true)
.build();
mAdapter = new TweetTimelineListAdapter(TwitterActivity.this, userTimeline);
mAdapter.registerDataSetObserver(mDataSetObserver);
((ListView) findViewById(R.id.tweet_list)).setAdapter(mAdapter);
}
@Override
public void failure(TwitterException e) {
Log.e(TwitterActivity.class.getName(), "Error performing guest login to twitter", e);
}
});
}
private DataSetObserver mDataSetObserver = new DataSetObserver() {
@Override
public void onChanged() {
super.onChanged();
// display data or error here based on results
// this code is never executed
}
};
Here's my proguard configuration file as recommended in the Fabric docs as well as some additions from me:
-dontwarn com.digits.sdk.android.*ActionBarActivity
# retrofit specific
-dontwarn com.squareup.okhttp.**
-dontwarn com.google.appengine.api.urlfetch.**
-dontwarn rx.**
-dontwarn retrofit.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {
@retrofit.http.* <methods>;
}
# GSON
-keep class com.google.gson.** { *; }
-keep interface com.google.gson.** { *; }
-dontwarn com.google.gson.**