AndroidHttpClient Nullpointerexception calling

A customer has reported a strange error. When doing a normal AndroidHttpClient.execute() in an AsyncTask, the app crashes and he gets the following stack trace

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(
at java.util.concurrent.FutureTask.finishCompletion(
at java.util.concurrent.FutureTask.setException(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: java.lang.NullPointerException
at android.os.AsyncTask$
... 3 more

Why is it calling checkMMSSendPermission and isSmsRequest? We are not using MMS and SMS at all, and the application do not have those permissions, which I guess is why it crashes. This works for all other 99.9% of our users.

Code looks like this

AndroidHttpClient client = AndroidHttpClient.newInstance(null);
        InputStream inputStream = null;
            HttpPost request = new HttpPost(urlString);
            HttpResponse response = client.execute(request);
            mResultStatus = response.getStatusLine().getStatusCode();
            inputStream = response.getEntity().getContent();

Any help would be welcome


This seems to be only affecting Sony Xperia Z, Z1 and ZR phones. Apparently the problems started to occur after receiving the update to Android 4.3. No one with those phones can use our app but for all else, it works.


Not sure why it's making calls to MMS and SMS methods but try doing this:

DefaultHttpClient client = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
try {
    HttpResponse execute = client.execute(httpPost);
    InputStream content = execute.getEntity().getContent();

This should work without any crashes.

Need Your Help

PHP and JQuery Button trigger not working

php jquery mysql button

Im currently new to PHP and JQuery after having using ASP.Net and C Sharp for the 2 years. I have this major problem in which i require some assistance in. mvc post model and specify hour

jquery datetime

Hi I ahve a model and it has Datetime typed property. When I post the form the hour of the date property hour should be 23:59. Which way is make sense.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.