Skip to content

[camera_android_camerax] Trying to record video with audio disabled results with SecurityException #175020

Closed

Description

@orestesgaolin

What package does this bug report belong to?

camera

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock

pubspec.lock.zip

Steps to reproduce

  1. Open example app of camera_android_camerax
  2. Run it on Android 15 Samsung S23
  3. Select camera and do not grant microphone permission
  4. Disable audio recording
  5. Start recording

Expected results

Recording should start without audio as per this PR flutter/packages#9264 and this issue #168551

Actual results

SecurityException is thrown:

Error: SecurityException
Error Message: java.lang.SecurityException: Attempted to enable audio for recording but application does not have RECORD_AUDIO permission granted.

Code sample

Code sample

https://github.com/flutter/packages/blob/main/packages/camera/camera_android_camerax/example/lib/main.dart

Screenshots or Videos

Screenshots / Video demonstration
example.mp4

Logs

Logs

log.log

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.35.3, on macOS 15.6.1 24G90 darwin-arm64, locale pl-PL) [461ms]
    • Flutter version 3.35.3 on channel stable at /Users/dominik/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a402d9a437 (3 days ago), 2025-09-03 14:54:31 -0700
    • Engine revision ddf47dd3ff
    • Dart version 3.9.2
    • DevTools version 2.48.0
    • Feature flags: enable-web, no-enable-linux-desktop, enable-macos-desktop, no-enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [865ms]
    • Android SDK at /Users/dominik/Library/Android/sdk
    • Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
    ✗ cmdline-tools component is missing.
      Try installing or updating Android Studio.
      Alternatively, download the tools from https://developer.android.com/studio#command-line-tools-only and make sure to set the ANDROID_HOME environment variable.
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [1 287ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [8ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [7ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-13047016-b750.29)

[✓] VS Code (version 1.103.2) [6ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.118.0

[✓] Connected device (5 available) [6,2s]
    • SM S911B (mobile)       • RFCW60DP85H                          • android-arm64  • Android 15 (API 35)
    • iPhone 12 mini (mobile) • 00008101-0001510C3CF0001E            • ios            • iOS 18.6.2 22G100
    • iPhone 16e (mobile)     • 433F5057-30A3-4238-B306-F427B186E9E0 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-5 (simulator)
    • macOS (desktop)         • macos                                • darwin-arm64   • macOS 15.6.1 24G90 darwin-arm64
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome 139.0.7258.155

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

Activity

  1. changed the title [-][camera_x] Trying to record video with audio disabled results with SecurityException[/-] [+][camera_android_camerax] Trying to record video with audio disabled results with SecurityException[/+] on Sep 6, 2025
  2. tirth-patel-nc commented on Sep 8, 2025

    @tirth-patel-nc
    Member

    @orestesgaolin thanks for the report. Couldn't replicate this on Pixel 6a or Samsung Galaxy S10.

    but leaving it open based on the exception for team’s input and tracking. does this also occur with camera_android?

  3. added
    platform-androidAndroid applications specifically
    team-androidOwned by Android platform team
    packageflutter/packages repository. See also p: labels.
    engineflutter/engine related. See also e: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Sep 8, 2025
  4. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Sep 8, 2025
  5. moved this from In Progress to [Blocking] Easy to delegate in Deprecating camera_androidon Sep 29, 2025
  6. Hieuntdz commented on Oct 31, 2025

    @Hieuntdz
  7. emakar commented on Nov 14, 2025

    @emakar
    Contributor

    @tirth-patel-nc try to reproduce with

        <uses-permission
            android:name="android.permission.RECORD_AUDIO"
            tools:node="remove" />
    

    in AndroidManifest.xml

  8. camsim99 commented on Jan 21, 2026

    @camsim99
    Contributor

    This was fixed by flutter/packages#10424.

  9. moved this from [Blocking] Easy to delegate to Done in Deprecating camera_androidon Jan 21, 2026
  10. github-actions commented on Feb 5, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work liste: device-specificOnly manifests on certain devicesengineflutter/engine related. See also e: labels.p: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions