java.lang.RuntimeException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

You need the permission android.permission.READ_EXTERNAL_STORAGE. Write on the Android Manifest

tip

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()

tip

MANAGE_USERS has a protection level of signature|system, so your application must be signed with the platform key. Take a look on this https://goo.gl/nXsTvH for more information about it.

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

  • Fatal exception error
    via Stack Overflow by user2850116
    ,
  • Class not working, Error occured?
    via Stack Overflow by Hari
    ,
  • Impacted Cases ============== Webapi usecase/Networking & Storage/FileReader Webapi usecase/Networking & Storage/FileSystem Webapi usecase/Device & Hardware/Camera Reproduce Test Steps ==================== 1. Download and install usecase_webapi_xwalk_tests.apk (download address please refer to the comment) 2. Launch the usecase_webapi_xwalk_tests.apk 3. Tap "Networking & Storage" -> Tap "FileReader" -> Tap "Open files" button -> Select an image, doc file, etc 5. Check the behavior Expected Outcome ================ Able to open the file Actual Outcome ============== App crash Test Builds =========== ||PackageVersion||Test Date|| Test Device ||Arch Mode|| Result|| |crosswalk 18.46.453.0|2015.12.16| Memo Pad8 | Shared / Embedded | {color:green}Pass{color} | |crosswalk 18.46.456.0|2015.12.21| Memo Pad8 | Shared / Embedded | {color:red}Fail{color} | Issue Analysis ============== Missing many permission compare with crosswalk 18.46.453.0. Error info: {code} E/XWalkViewInternal(11322): Unable to create Image File E/XWalkViewInternal(11322): java.io.IOException: open failed: EACCES (Permission denied) E/XWalkViewInternal(11322): at java.io.File.createNewFile(File.java:946) E/XWalkViewInternal(11322): at java.io.File.createTempFile(File.java:1011) E/XWalkViewInternal(11322): at org.xwalk.core.internal.XWalkViewInternal.createImageFile(XWalkViewInternal.java:1342) E/XWalkViewInternal(11322): at org.xwalk.core.internal.XWalkViewInternal.showFileChooser(XWalkViewInternal.java:1294) E/XWalkViewInternal(11322): at org.xwalk.core.internal.XWalkContentsClientBridge.shouldOverrideRunFileChooser(XWalkContentsClientBridge.java:644) E/XWalkViewInternal(11322): at org.xwalk.core.internal.XWalkWebContentsDelegateAdapter.shouldOverrideRunFileChooser(XWalkWebContentsDelegateAdapter.java:113) E/XWalkViewInternal(11322): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) E/XWalkViewInternal(11322): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:37) E/XWalkViewInternal(11322): at android.os.Handler.dispatchMessage(Handler.java:102) E/XWalkViewInternal(11322): at android.os.Looper.loop(Looper.java:149) E/XWalkViewInternal(11322): at android.app.ActivityThread.main(ActivityThread.java:5061) E/XWalkViewInternal(11322): at java.lang.reflect.Method.invokeNative(Native Method) E/XWalkViewInternal(11322): at java.lang.reflect.Method.invoke(Method.java:515) E/XWalkViewInternal(11322): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788) E/XWalkViewInternal(11322): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) E/XWalkViewInternal(11322): at dalvik.system.NativeStart.main(Native Method) E/XWalkViewInternal(11322): Caused by: libcore.io.ErrnoException: open failed: EACCES (Permission denied) E/XWalkViewInternal(11322): at libcore.io.Posix.open(Native Method) E/XWalkViewInternal(11322): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) E/XWalkViewInternal(11322): at java.io.File.createNewFile(File.java:939) E/XWalkViewInternal(11322): ... 15 more ...... E/AndroidRuntime(11322): FATAL EXCEPTION: main E/AndroidRuntime(11322): Process: org.xwalk.usecase_webapi_xwalk_tests, PID: 11322 E/AndroidRuntime(11322): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://media/external/images/media/366 }} to activity {org.xwalk.usecase_webapi_xwalk_tests/org.xwalk.usecase_webapi_xwalk_tests.Usecase_webapi_xwalk_testsActivity}: java.lang.RuntimeException: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/366 from pid=11322, uid=17435 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() E/AndroidRuntime(11322): at android.app.ActivityThread.deliverResults(ActivityThread.java:3405) E/AndroidRuntime(11322): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3448) E/AndroidRuntime(11322): at android.app.ActivityThread.access$1300(ActivityThread.java:138) E/AndroidRuntime(11322): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284) E/AndroidRuntime(11322): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(11322): at android.os.Looper.loop(Looper.java:149) E/AndroidRuntime(11322): at android.app.ActivityThread.main(ActivityThread.java:5061) E/AndroidRuntime(11322): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(11322): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(11322): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788) E/AndroidRuntime(11322): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) E/AndroidRuntime(11322): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(11322): Caused by: java.lang.RuntimeException: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/366 from pid=11322, uid=17435 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() E/AndroidRuntime(11322): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:67) E/AndroidRuntime(11322): at org.xwalk.core.XWalkView.onActivityResult(XWalkView.java:546) E/AndroidRuntime(11322): at org.xwalk.app.runtime.XWalkCoreProviderImpl.onActivityResult(XWalkCoreProviderImpl.java:67) E/AndroidRuntime(11322): at org.xwalk.app.runtime.XWalkRuntimeView.onActivityResult(XWalkRuntimeView.java:135) E/AndroidRuntime(11322): at org.xwalk.app.XWalkRuntimeActivityBase.onActivityResult(XWalkRuntimeActivityBase.java:106) E/AndroidRuntime(11322): at android.app.Activity.dispatchActivityResult(Activity.java:5579) E/AndroidRuntime(11322): at android.app.ActivityThread.deliverResults(ActivityThread.java:3401) E/AndroidRuntime(11322): ... 11 more E/AndroidRuntime(11322): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/366 from pid=11322, uid=17435 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() E/AndroidRuntime(11322): at android.os.Parcel.readException(Parcel.java:1465) E/AndroidRuntime(11322): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185) E/AndroidRuntime(11322): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137) E/AndroidRuntime(11322): at android.content.ContentProviderProxy.query(ContentProviderNative.java:413) E/AndroidRuntime(11322): at android.content.ContentResolver.query(ContentResolver.java:461) E/AndroidRuntime(11322): at android.content.ContentResolver.query(ContentResolver.java:404) E/AndroidRuntime(11322): at org.xwalk.core.internal.XWalkContentsClientBridge$1UriCallback.resolveFileName(XWalkContentsClientBridge.java:585) E/AndroidRuntime(11322): at org.xwalk.core.internal.XWalkContentsClientBridge$3.onReceiveValue(XWalkContentsClientBridge.java:625) E/AndroidRuntime(11322): at org.xwalk.core.internal.XWalkContentsClientBridge$3.onReceiveValue(XWalkContentsClientBridge.java:602) E/AndroidRuntime(11322): at org.xwalk.core.internal.XWalkViewInternal.onActivityResult(XWalkViewInternal.java:714) E/AndroidRuntime(11322): at org.xwalk.core.internal.XWalkViewBridge.onActivityResultSuper(XWalkViewBridge.java:399) E/AndroidRuntime(11322): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(11322): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(11322): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:61) E/AndroidRuntime(11322): ... 17 more {code}
    via by Xie, XiaolongX,
    • java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=400, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:104460 flg=0x1 }} to activity {com.example.user.cameratoserver/com.example.user.cameratoserver.MainActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=17286, uid=10038 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() at android.app.ActivityThread.deliverResults(ActivityThread.java:3798) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3841) at android.app.ActivityThread.access$1400(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1440) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:234) at android.app.ActivityThread.main(ActivityThread.java:5526) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=17286, uid=10038 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1627) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135) at android.content.ContentProviderProxy.query(ContentProviderNative.java:427) at android.content.ContentResolver.query(ContentResolver.java:497) at android.content.ContentResolver.query(ContentResolver.java:439) at com.kosalgeek.android.photoutil.RealPathUtil.getDataColumn(RealPathUtil.java:131) at com.kosalgeek.android.photoutil.RealPathUtil.getRealPathFromURI_API19(RealPathUtil.java:62) at com.kosalgeek.android.photoutil.GalleryPhoto.getPath(GalleryPhoto.java:49) at com.example.user.cameratoserver.MainActivity.onActivityResult(MainActivity.java:100) at android.app.Activity.dispatchActivityResult(Activity.java:6490) at android.app.ActivityThread.deliverResults(ActivityThread.java:3794) ... 9 more

    Users with the same issue

    filipebatista
    12 times, last one,
    winer222
    3 times, last one,
    Indri Yunita
    8 times, last one,
    gamebusterz
    7 times, last one,
    Riyaz
    3 times, last one,
    231 more bugmates