Crash at TwitterSession.<init> (Session <init>) for rooted users




we are using the Twitter SDK for android for authentication. Strangely we are recording crashes for a specific rooted user which seem to be related to tweeting.
There crash trace is the following:

Fatal Exception: java.lang.IllegalArgumentException: AuthToken must not be null.
       at android.os.Handler.dispatchMessage(
       at android.os.Looper.loop(

We don’t provide any functionality for tweeting in our app, only authentication. Where can this crash be coming from? Is there a way to catch this Exception to prevent the app from crashing?

We are also getting this Exception (related to Gallery function, which we also do not use):

Caused by java.lang.NullPointerException (

Is this caused by the user rooting his/her device? What can we do to prevent our app from crashing from that?

Thanks and Best Regards,


It seems like those crashes are caused by quirky devices/OSes used for automated tests. Just like it was discovered here:

It would still be nice to not have those crashes recorded everytime.


If you are only using Twitter Kit for login you can just include the Twitter Core library. This should also shrink your SDK size.

dependencies {
    compile ''

Note: For awhile now I suspected the issue was due to automated testing. Nice to see I am not the old one.


Thanks for the tip. I will certainly do that!