Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android6.0以上拍照闪退 #167

Closed
IdyllicFish opened this issue Jul 14, 2017 · 8 comments
Closed

Android6.0以上拍照闪退 #167

IdyllicFish opened this issue Jul 14, 2017 · 8 comments

Comments

@IdyllicFish
Copy link

貌似是因为拍照没有动态申请拍照的权限
希望能够修复 不然只能在需打开相册之前就手动申请相机权限

@sheep0704
Copy link
Member

日志

@IdyllicFish
Copy link
Author

07-21 17:20:00.187 3200-3200/com.zhixin.partyconstructionwebapp D/AndroidRuntime: Shutting down VM

                                                                              --------- beginning of crash

07-21 17:20:00.187 3200-3200/com.zhixin.partyconstructionwebapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zhixin.partyconstructionwebapp, PID: 3200
java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list U:file:///storage/emulated/0/DCIM/IMMQY/IMG_20170721172000.jpg} (has extras) } from ProcessRecord{fe2781c 3200:com.zhixin.partyconstructionwebapp/u0a131} (pid=3200, uid=10131) with revoked permission android.permission.CAMERA
at android.os.Parcel.readException(Parcel.java:1599)
at android.os.Parcel.readException(Parcel.java:1552)
at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2658)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1507)
at android.app.Activity.startActivityForResult(Activity.java:3917)
at android.support.v4.app.BaseFragmentActivityJB.startActivityForResult(BaseFragmentActivityJB.java:50)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:79)
at android.support.v4.app.ActivityCompatJB.startActivityForResult(ActivityCompatJB.java:30)
at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:146)
at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:937)
at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:1047)
at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:959)
at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:948)
at cn.finalteam.rxgalleryfinal.ui.fragment.BaseFragment.startActivityForResult(BaseFragment.java:91)
at cn.finalteam.rxgalleryfinal.ui.fragment.MediaGridFragment.openCamera(MediaGridFragment.java:588)
at cn.finalteam.rxgalleryfinal.ui.fragment.MediaGridFragment.onObItemClick(MediaGridFragment.java:485)
at cn.finalteam.rxgalleryfinal.ui.fragment.MediaGridFragment.onItemClick(MediaGridFragment.java:473)
at cn.finalteam.rxgalleryfinal.ui.widget.FooterAdapter.lambda$onBindViewHolder$11(FooterAdapter.java:45)
at cn.finalteam.rxgalleryfinal.ui.widget.FooterAdapter.access$lambda$0(FooterAdapter.java)
at cn.finalteam.rxgalleryfinal.ui.widget.FooterAdapter$$Lambda$1.onClick(Unknown Source)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
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)
点击拍照后会闪退,没有申请拍照权限

@IdyllicFish
Copy link
Author

java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera2/com.android.camera.CaptureActivity clip={text/uri-list U:file:///storage/emulated/0/DCIM/IMMQY/IMG_20170721172000.jpg} (has extras) } from ProcessRecord{fe2781c 3200:com.zhixin.partyconstructionwebapp/u0a131} (pid=3200, uid=10131) with revoked permission android.permission.CAMERA

@7449
Copy link
Contributor

7449 commented Jul 23, 2017

你有没有在你的 Androidmanifest.xml 下 申请 android.permission.CAMERA,Library的 Androidmanifest 什么都没有写,还是建议在使用之前就申请到所有的权限,我这边会在处理下 点击 拍照的权限问题

@IdyllicFish
Copy link
Author

IdyllicFish commented Jul 23, 2017 via email

@7449
Copy link
Contributor

7449 commented Jul 23, 2017

我刚才看了下 ,代码中没有对camera权限做处理,我稍后会处理下,sample取巧了.

@IdyllicFish
Copy link
Author

IdyllicFish commented Jul 23, 2017 via email

@sheep0704
Copy link
Member

FIX

sheep0704 added a commit that referenced this issue Jul 26, 2017
OK.fix #170,#165 ,#167 and fix Image No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants