Skip to content

Take picture returns CameraException(system_error, Failed to get capture path for picture) #180559

@tsafundzic

Description

@tsafundzic

What package does this bug report belong to?

camera

What target platforms are you seeing this bug on?

Windows

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
[Paste file content here]

Steps to reproduce

  1. Take picture on Windows
  2. Picture isn't taken, error is thrown: CameraException(system_error, Failed to get capture path for picture)

Expected results

Picture is taken and saved

Actual results

Picture is not taken, error is thrown CameraException(system_error, Failed to get capture path for picture).

Also, in PowerShell:

[Environment]::GetFolderPath("MyPictures")
returns Picture folder path, but:

Add-Type -AssemblyName System.Runtime.WindowsRuntime
$folder = [Windows.Storage.KnownFolders]::PicturesLibrary
$folder.Path

returns

Add-Type -AssemblyName System.Runtime.WindowsRuntime $folder = [Windows.Storage.KnownFolders]::PicturesLibrary $folder.Path returns: Unable to find type [Windows.Storage.KnownFolders]. At line:2 char:11 + $folder = [Windows.Storage.KnownFolders]::PicturesLibrary + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Windows.Storage.KnownFolders:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound

Code sample

Code sample
Future<void> takePhoto(BuildContext context) async {
    try {
      final image = await _controller.takePicture();

      if (context.mounted) {
        setState(() {
          flashOff();
          imagePath = image.path;
        });
      }
    } catch (e) {
      final msg = 'Take photo error: $e';
      Print.error(msg);
    }
  }

Screenshots or Videos

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.27.4, on Microsoft Windows [Version 10.0.19045.6456], locale hr-HR)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.0.0)
[√] Android Studio (version 2025.2.1)
[√] VS Code (version 1.107.1)
[√] VS Code, 32-bit edition (version 1.24.1)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions