Closed bartekpacia closed 4 years ago
That's because you don't have permission
Could you elaborate a bit?
Your app doesn't have permission to use camera, so it crashes.
In library's README is written "Takes responsibility for all needed permissions", and maybe it was a bit misleading. It takes responsibility when picker is shown. If you start intent for camera from somewhere else in your app, you should check permission on your own. And as I can see in your function you don't do this
Thanks, I'll request the permissions and try again.
I simply put
implementation "com.github.ChiliLabs:ChiliPhotoPicker:0.2.0"
in my app/build.gradle and app started crashing with this exception:java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.sec.android.app.camera/.Camera clip={text/uri-list U:content://pl.baftek.discoverrudy.fileprovider/Comment%20images/commentphoto_20191120_192059_6067355174982695808.jpg} (has extras) } from ProcessRecord{d346b7fd0 20377:pl.baftek.discoverrudy/u0a281} (pid=20377, uid=10281) with revoked permission android.permission.CAMERA
Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:2118) at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:892) at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:662) at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1511) at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:603)
Code that causes this to happen:
I've tested it and I'm certaing that implementation of this library is the only reason why my app crashes. When I write
implementation ...
, app crashes while executing the aforementioned block of code. I totally don't have any idea why this thing happens. It's a pity, because I'm currenly looking for a lib like this.