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

android

#1

Hi,

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 com.twitter.sdk.android.core.Session.<init>(Session.java:34)
       at com.twitter.sdk.android.core.TwitterSession.<init>(TwitterSession.java:46)
       at com.twitter.sdk.android.tweetcomposer.TweetUploadService.onHandleIntent(TweetUploadService.java:75)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.os.HandlerThread.run(HandlerThread.java:60)

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
com.twitter.sdk.android.tweetui.GalleryActivity.onCreate (GalleryActivity.java:54)

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,
Tobias


#2

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.


#3

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 'com.twitter.sdk.android:twitter-core:3.1.1'
}

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


#4

Thanks for the tip. I will certainly do that!