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

[BUG] Inappropriate handling when access denied #232

Closed
Jinxishihenian opened this issue Jan 11, 2024 · 6 comments · Fixed by #235
Closed

[BUG] Inappropriate handling when access denied #232

Jinxishihenian opened this issue Jan 11, 2024 · 6 comments · Fixed by #235
Labels
r: camera Related to the camera package. s: bug Something isn't working

Comments

@Jinxishihenian
Copy link

Jinxishihenian commented Jan 11, 2024

Describe the bug

When I currently select an image using this component, the authorization screen pops up and the application crashes when I deny access.
How to reproduce

                     // Take pictures and upload them.
                          final AssetEntity? entity =
                              await CameraPicker.pickFromCamera(
                            context,
                            pickerConfig: const CameraPickerConfig(
                              enableRecording: false,
                              onlyEnableRecording: false,
                            ),
                          );

Steps to reproduce the behavior:

  1. Invoke the shooting method.
  2. The authorization pop-up window is displayed.
  3. Click Reject, and the application crashes.

Expected behavior

Disable access to the camera or album, and prompt no permission
Screenshots (If contains)

Version information

  • Device: [nova 5 Pro]
  • OS: []
  • Package Version: [^8.8.0]
  • Flutter Version: [3.16.3]

Additional context

 When I refused to grant permission, I didn't print logs
D/RtgSchedIpcFile( 8935): setCommandByIoctl failed ret:-1, cmdid:22, errno:103
E/flutter ( 8935): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CameraException(CameraAccessDenied, Camera access permission was denied.)
E/flutter ( 8935): #0      AndroidCamera.createCamera (package:camera_android/src/android_camera.dart:112:7)
E/flutter ( 8935): <asynchronous suspension>
E/flutter ( 8935): fluttercandies/flutter_wechat_assets_picker#1      CameraController._initializeWithDescription (package:camera/src/camera_controller.dart:316:19)
E/flutter ( 8935): <asynchronous suspension>
E/flutter ( 8935): fluttercandies/flutter_wechat_assets_picker#2      CameraPickerState.initCameras.<anonymous closure> (package:wechat_camera_picker/src/states/camera_picker_state.dart:395:9)
E/flutter ( 8935): <asynchronous suspension>
E/flutter ( 8935): 
    
@Jinxishihenian Jinxishihenian added the await investigate The issue is waiting for further investigation. label Jan 11, 2024
@AlexV525
Copy link
Member

Crashes? Please provide a screen record.

@AlexV525 AlexV525 added i: lack of information Further information is requested and removed await investigate The issue is waiting for further investigation. labels Jan 11, 2024
@Jinxishihenian
Copy link
Author

log information
image

image
image

Screen information

video.1.mp4

@AlexV525 AlexV525 transferred this issue from fluttercandies/flutter_wechat_assets_picker Jan 11, 2024
@AlexV525 AlexV525 added s: bug Something isn't working await investigate The issue is waiting for further investigation. r: camera Related to the camera package. and removed i: lack of information Further information is requested labels Jan 11, 2024
@Jinxishihenian
Copy link
Author

I appreciate your attention to this issue

@Jinxishihenian
Copy link
Author

Currently using plugins to judge permissions in advance, this can make me work well

PermissionStatus status =  await Permission.camera.request();
if (status.isGranted) {
}else{
}

@Jinxishihenian
Copy link
Author

image
I have something to do with the library you rely on
https://pub.dev/packages/camera

@AlexV525
Copy link
Member

I confirmed that the issue is caused by the recursive calls. Fixing.

@AlexV525 AlexV525 removed the await investigate The issue is waiting for further investigation. label Feb 26, 2024
@AlexV525 AlexV525 changed the title [BUG] Error with something [BUG] Inappropriate handling when access denied Feb 26, 2024
@AlexV525 AlexV525 linked a pull request Feb 27, 2024 that will close this issue
@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r: camera Related to the camera package. s: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants