Android 12 crash java.lang.SecurityException



Posted Feb 25, 2022

Hi support team,

We are getting in firebase the following crash for Android 12:

Dependencies used:

com.zendesk:messaging -> version 5.2.3
com.zendesk:support -> version 5.0.7
zendesk.support.request.CellBindHelper.openAttachment
Fatal Exception: java.lang.SecurityException: UID 10303 does not have permission to content://media/external/file/119192 [user 0]
       at android.os.Parcel.createExceptionOrNull(Parcel.java:2437)
       at android.os.Parcel.createException(Parcel.java:2421)
       at android.os.Parcel.readException(Parcel.java:2404)
       at android.os.Parcel.readException(Parcel.java:2346)
       at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2897)
       at android.app.Instrumentation.execStartActivity(Instrumentation.java:1749)
       at android.app.Activity.startActivityForResult(Activity.java:5465)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:588)
       at android.app.Activity.startActivityForResult(Activity.java:5423)
       at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
       at android.app.Activity.startActivity(Activity.java:5809)
       at android.app.Activity.startActivity(Activity.java:5762)
       at zendesk.support.request.CellBindHelper.openAttachment(CellBindHelper.java:100)
       at zendesk.support.request.CellBindHelper.access$000(CellBindHelper.java:32)
       at zendesk.support.request.CellBindHelper$3.onClick(CellBindHelper.java:87)
       at android.view.View.performClick(View.java:7792)
       at android.view.View.performClickInternal(View.java:7769)
       at android.view.View.access$3800(View.java:910)
       at android.view.View$PerformClick.run(View.java:30184)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8633)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Thanks in advance!


1

16

16 comments

@Aleksandr Vakhtin what lib did you update ?

0


As I understand, it was related granular media permissions which was introduced in android 12
It was fixed in zendesk 5.1.0. I updated to it recently and all working fine

Thanks for helping, Greg

0


Hello Greg, hope you are well and safe,


Of course I'm asking system for files(media) permissions. I've checked asking it right before open zendesk manually and automatically by zendesk sdk itself. The same result with crash.
I would like at least to have suppressed exception at this place.

0


Hi Aleksandr! That trace is indicating that you need to receive permission to access files on that device. I would recommend reading the appropriate docs for Android's permissions and update your app accordingly.

-1


Still reproducing

com.zendesk:support -> version 5.0.7


Steps:

  • Open chat (creating request)
  • Select one or more files
  • Send it
  • Tap on image in chat right after sending
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.appclose.androidapp, PID: 6908
    java.lang.SecurityException: UID 10149 does not have permission to content://media/external/file/36 [user 0]
        at android.os.Parcel.createExceptionOrNull(Parcel.java:2425)
        at android.os.Parcel.createException(Parcel.java:2409)
        at android.os.Parcel.readException(Parcel.java:2392)
        at android.os.Parcel.readException(Parcel.java:2334)
        at android.app.IActivityTaskManager$Stub$Proxy.startActivity(IActivityTaskManager.java:2326)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1758)
        at android.app.Activity.startActivityForResult(Activity.java:5407)
        at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:705)
        at android.app.Activity.startActivityForResult(Activity.java:5365)
        at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:686)
        at android.app.Activity.startActivity(Activity.java:5751)
        at android.app.Activity.startActivity(Activity.java:5704)
        at zendesk.support.request.CellBindHelper.openAttachment(CellBindHelper.java:100)
        at zendesk.support.request.CellBindHelper.access$000(CellBindHelper.java:32)
        at zendesk.support.request.CellBindHelper$3.onClick(CellBindHelper.java:87)
        at android.view.View.performClick(View.java:7455)
        at android.view.View.performClickInternal(View.java:7432)
        at android.view.View.access$3700(View.java:835)
        at android.view.View$PerformClick.run(View.java:28810)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7842)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.uri.UriGrantsManagerService.checkGrantUriPermissionUnlocked(UriGrantsManagerService.java:1254)
        at com.android.server.uri.UriGrantsManagerService.checkGrantUriPermissionFromIntentUnlocked(UriGrantsManagerService.java:621)
        at com.android.server.uri.UriGrantsManagerService.access$1000(UriGrantsManagerService.java:107)
        at com.android.server.uri.UriGrantsManagerService$LocalService.checkGrantUriPermissionFromIntent(UriGrantsManagerService.java:1410)
        at com.android.server.wm.ActivityStarter$Request.resolveActivity(ActivityStarter.java:539)

0


Hi Nikolai,

Which version of our SDK are you using? If you can upgrade to the latest version, the problem should be resolved. If not, let me know please.

Thanks!

0


Have the same crash on Samsung with Android 12

0


Hey Eric Nelson,

Any updates regarding this crash? Have been noticing this issue for a while now, most of the crashes are being recorded on Samsung devices running Android 12. There seems to be no user-specific information available at the moment and was unable to reproduce this crash at will.
Thanks in advance.

1


Hey Jav,

I've passed this along to the corresponding dev team. Have you checked with the users affected to see if this causing an actual crash of the application? At the moment we think this is just a caching issue that they're looking to address in a future release. If it's causing a full crash of the app for the user and isn't just background noise, this will obviously take a higher priority.

Thanks!

0


Hi Eric, 

Any luck with this crash?

0


Sign in to leave a comment.

Didn't find what you're looking for?

New post