java.lang.RuntimeException

An error occurred while executing doInBackground()

Samebug tips5

Android SDK 23 introduced a new way to handle permissions, so as a temporary workaround you can set it to build for SDK below 23. As a permanent solution you have to ask user during runtime for permissions with checkSelfPermission() or requestPermissions()


rafaelrafael

You need the permission android.permission.READ_EXTERNAL_STORAGE. Write <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> on the Android Manifest


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web1297

  • via Stack Overflow by HenryChuang
    ,
  • via Stack Overflow by manuzhang
    ,
  • Stack trace

    • java.lang.RuntimeException: An error occurred while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354) at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.SmsProvider uri content://sms/ from pid=24160, uid=10244 requires android.permission.READ_SMS, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1620) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) at android.content.ContentProviderProxy.query(ContentProviderNative.java:421) at android.content.ContentResolver.query(ContentResolver.java:502) at android.content.CursorLoader.loadInBackground(CursorLoader.java:64) at android.content.CursorLoader.loadInBackground(CursorLoader.java:42) at android.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:312) at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:69) at android.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:57) at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237) ... 3 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    narionario
    Once,
    233 more bugmates