flutter / flutter/flutter

[camera_windows] Fallback to temp dir when Pictures / Videos known folder cannot be resolved.

Open
#192,302 1 comment 0 reactions 0 assignees View on GitHub
has reproducible steps p: camera P3 package platform-windows team-windows triaged-windows
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

- Activate Windows security ransomware protection.
- Deliberately protect `C:\Users\\Pictures` folder.
- Try to take picture from camera.

### Expected results

The picture should be saved anyway in temp folder.

### Actual results

Exception:
FlutterError("system_error", "Failed to get capture path for picture")

### Code sample

Code sample

```dart
CameraController.takePicture();
```

### Screenshots or Video

_No response_

### Logs

_No response_

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.47.2, on Microsoft Windows [version 10.0.26200.9168], locale fr-FR) [319ms]
• Flutter version 3.47.2 on channel stable at D:\dev\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d3b14c8769 (9 days ago), 2026-08-26 16:07:51 -0700
• Engine revision a804b26164
• Dart version 3.13.2
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android,
enable-ios, cli-animations, enable-native-assets, enable-record-use, enable-swift-package-manager,
omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Windows Version (Windows 11 or higher, 25H2, 2009) [561ms]

[!] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [349ms]
• Android SDK at C:\Users\foo\AppData\Local\Android\sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-37.0, build-tools 36.0.0
! Multiple adb binaries found. This can cause conflicts and device detection issues:
- C:\Users\foo\AppData\Local\Android\Sdk\platform-tools\adb.exe
- C:\Program Files\platform-tools\adb.exe
• Java binary at: D:\dev\java\jdk17\bin\java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment Temurin-17.0.15+6 (build 17.0.15+6)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/to/windows-android-setup for more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) [71ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.39 (August 2026)) [70ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.14.37614.0
• Windows 10 SDK version 10.0.26100.0

[✓] Connected device (2 available) [281ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [version 10.0.26200.9168]
• Edge (web) • edge • web-javascript • Microsoft Edge 152.0.4191.53

[✓] Network resources [309ms]
• All expected network resources are available.

! Doctor found issues in 2 categories.
```

Contributor guide

Open the contributing guide

Research direction

Start at the camera_windows implementation behind CameraController.takePicture and trace how the capture path is resolved when the Windows Pictures or Videos known folder is unavailable. Reproduce with ransomware protection enabled and a protected Pictures folder. Done means the picture is saved in a temp directory instead of raising the capture-path system_error.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.