A lot of ANR after Twitter SDK update to 3.0.0

android

#1

Hi!

After upgrading Twitter SDK to the new version we have now a lot of ANR errors while application trying to display Tweets on recyclerview.

Stacktrace: https://pastebin.com/bW0BZ0E3

It happens on every Android versions

Thanks for help!


#2

Looks like this is because TweetUi is being initialized for the first time in the RecycleView. You can try calling TweetUi.getInstance() at application startup or off the main thread.

I will look into it further. If you have a good repo case it would be helpful.


#3

Hi!

I changed

Twitter.initialize(this);

to

Twitter.initialize(this);
new Thread(() -> TweetUi.getInstance()).start();

in my application class. After small tests, looks like it helps.

I will update my app with this “fix” for beta users, and I will let You know after couple of days.


TwitterKit 3 causes black screen for long time on app launching (Android)
#4

Hi,

Above fix helped us. Thanks for help!

Greetings


#5