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] black screen when using camera and no photos listed #480

Closed
ejbdobp opened this issue Aug 22, 2023 · 7 comments · Fixed by fluttercandies/flutter_wechat_camera_picker#191
Labels
await response Issue require customer's further response. b: third party This is a third party package issue. s: bug Something isn't working.

Comments

@ejbdobp
Copy link

ejbdobp commented Aug 22, 2023

Describe the bug
Black screen when loading images, the folders can be accessed but the photos are not appearing. When camera picker is selected the app freezes

How to reproduce
Only iphone 13 displays this erratic behavior, when using the same app with android it works alright. Tested with iphone 7 and 11 and there is no issue

The permissions are enabled

Any idea what could be the problem?

Screenshot_2023-08-22-18-45-56-846_com miui videoplayer

Screenshot_2023-08-22-18-46-15-352_com miui videoplayer

Screenshot_2023-08-22-18-45-59-416_com miui videoplayer

Version information

  • Device: iPhone 13 pro max
  • Package Version: 8.5.0
  • Flutter Version: 3.10.6
@ejbdobp ejbdobp added the await investigate The issue is waiting for further investigation. label Aug 22, 2023
@github-actions github-actions bot added the await triage The issue is waiting for triage. label Aug 22, 2023
@ejbdobp
Copy link
Author

ejbdobp commented Aug 22, 2023

Here is the code i used:

_uploadImage() async {
      final List<AssetEntity>? assets = await AssetPicker.pickAssets(context,
          pickerConfig: AssetPickerConfig(
            requestType: RequestType.image,
            specialItemPosition: SpecialItemPosition.prepend,
            specialItemBuilder: (
              BuildContext context,
              AssetPathEntity? path,
              int length,
            ) {
              if (path?.isAll != true) {
                return null;
              }
              return Semantics(
                label: 'Take a picture',
                button: true,
                onTapHint: 'Take a picture',
                child: GestureDetector(
                  behavior: HitTestBehavior.opaque,
                  onTap: () async {
                    Feedback.forTap(context);
                    final AssetEntity? result =
                        await CameraPicker.pickFromCamera(context,
                            pickerConfig:
                                CameraPickerConfig(
                                    textDelegate:
                                        EnglishCameraPickerTextDelegate()));
                    if (result == null) {
                      return;
                    }
                    final AssetPicker<AssetEntity, AssetPathEntity> picker =
                        context.findAncestorWidgetOfExactType()!;
                    final DefaultAssetPickerBuilderDelegate builder =
                        picker.builder as DefaultAssetPickerBuilderDelegate;
                    final DefaultAssetPickerProvider p = builder.provider;
                    await p.switchPath(p.currentPath!);
                    p.selectAsset(result);
                  },
                  child: const Center(
                    child: Icon(Icons.camera_enhance, size: 42.0),
                  ),
                ),
              );
            },
          ));
      if (assets != null) {

@zhangshuqi
Copy link

Encountered the same problem, have you resolved it?

@AlexV525
Copy link
Member

@ejbdobp Can you verify if the problem exist when you use the camera picker alone?

@ejbdobp
Copy link
Author

ejbdobp commented Aug 25, 2023

the error was from our customer. we tested on the same iphone 13 device and it worked fine and we are not able to replicate the error. however the problem is still present on the customers phone.

Hi @zhangshuqi, could you give more information on your error?

@ejbdobp
Copy link
Author

ejbdobp commented Aug 25, 2023

ill create a project with camera picker alone please wait

@ejbdobp
Copy link
Author

ejbdobp commented Aug 25, 2023

Hi @AlexV525 i think the closest i can replicate the issue for the camera picker is using the example project on Nexus 5x API 30 simulator, repeatedly tapping "Taking photos" example and tapping close on the camera. what happens is it will get to a black screen with the close, flash and rotate controls gone (only the main take photo button is left and is untappable)

Screenshot_1692948299
Screenshot_1692948303
Screenshot_1692948306

However on a real android device, it happened this morning, that the black screen appeared on first use of camera picker, it froze and there is nothing to do. the user has to tap back and restart the camera for it to work. here is the screenshot. this only happened on first use of the app.

369822849_260655546914808_2662542769405944569_n

for the customer i mentioned above, the black screen always appear and the camera never works despite the permissions enabled.

@AlexV525
Copy link
Member

So I guess it's a camera picker issue. Could you identify if fluttercandies/flutter_wechat_camera_picker#191 can fix your case?

@AlexV525 AlexV525 added s: bug Something isn't working. await response Issue require customer's further response. b: third party This is a third party package issue. and removed await triage The issue is waiting for triage. await investigate The issue is waiting for further investigation. labels Aug 27, 2023
AlexV525 added a commit to fluttercandies/flutter_wechat_camera_picker that referenced this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
await response Issue require customer's further response. b: third party This is a third party package issue. s: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants