MediaService call back throws Null Pointer Exception



This is how I am trying to post image…

 RequestBody file = RequestBody.create(MediaType.parse("image/*"), mediaPath);
        TwitterApiClient authClient = TwitterCore.getInstance().getApiClient(session);
        MediaService ms = authClient.getMediaService();
        ms.upload(file, null, null).enqueue(new Callback<Media>() {
            public void success(Result<Media> result) {
                Log.e(TAG, "result ID: " +;

            public void failure(TwitterException e) {

It gives me a null pointer exception.

java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference


Moving to the Twitter Kit category since this is specific to mobile.